Skip to content

Commit 2c3662c

Browse files
Make X-Ray fluid rendering even more consistent
It should now be consistent enough to use the same screenshot templates for both Sodium and Indigo. At least it is on my graphics drivers. We'll see how xvfb handles it...
1 parent 9647caa commit 2c3662c

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/gametest/java/net/wurstclient/gametest/tests/XRayHackTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public static void testXRayHack(ClientGameTestContext context,
3838
input.pressKey(GLFW.GLFW_KEY_X);
3939
waitForChunkReloading(context, world);
4040
assertScreenshotEquals(context, "xray_default",
41-
WurstTest.IS_MOD_COMPAT_TEST ? "https://i.imgur.com/erO3kia.png"
42-
: "https://i.imgur.com/Dftamqv.png");
41+
"https://i.imgur.com/Dftamqv.png");
4342

4443
// Exposed only
4544
runWurstCommand(context, "setcheckbox X-Ray only_show_exposed on");
@@ -48,8 +47,7 @@ public static void testXRayHack(ClientGameTestContext context,
4847
input.pressKey(GLFW.GLFW_KEY_X);
4948
waitForChunkReloading(context, world);
5049
assertScreenshotEquals(context, "xray_exposed_only",
51-
WurstTest.IS_MOD_COMPAT_TEST ? "https://i.imgur.com/yjCT7jI.png"
52-
: "https://i.imgur.com/QlEpQTu.png");
50+
"https://i.imgur.com/QlEpQTu.png");
5351

5452
// Opacity mode
5553
runWurstCommand(context, "setcheckbox X-Ray only_show_exposed off");
@@ -58,8 +56,7 @@ public static void testXRayHack(ClientGameTestContext context,
5856
input.pressKey(GLFW.GLFW_KEY_X);
5957
waitForChunkReloading(context, world);
6058
assertScreenshotEquals(context, "xray_opacity",
61-
WurstTest.IS_MOD_COMPAT_TEST ? "https://i.imgur.com/LKaCXNd.png"
62-
: "https://i.imgur.com/0nLulJn.png");
59+
"https://i.imgur.com/0nLulJn.png");
6360

6461
// Exposed only + opacity
6562
runWurstCommand(context, "setcheckbox X-Ray only_show_exposed on");
@@ -68,8 +65,7 @@ public static void testXRayHack(ClientGameTestContext context,
6865
input.pressKey(GLFW.GLFW_KEY_X);
6966
waitForChunkReloading(context, world);
7067
assertScreenshotEquals(context, "xray_exposed_only_opacity",
71-
WurstTest.IS_MOD_COMPAT_TEST ? "https://i.imgur.com/0OmJCsi.png"
72-
: "https://i.imgur.com/noPWDUl.png");
68+
"https://i.imgur.com/noPWDUl.png");
7369

7470
// Clean up
7571
runCommand(server, "fill ~-5 ~-2 ~5 ~5 ~5 ~7 air");

src/main/java/net/wurstclient/mixin/FluidRendererMixin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ private boolean modifyShouldSkipRendering(Direction side, float height,
4646
BlockAndTintGetter world, BlockPos pos, VertexConsumer vertexConsumer,
4747
BlockState blockState, FluidState fluidState)
4848
{
49+
// Note: the null BlockPos is here to skip the "exposed only" check
4950
ShouldDrawSideEvent event = new ShouldDrawSideEvent(blockState, null);
5051
EventManager.fire(event);
5152

src/main/java/net/wurstclient/mixin/sodium/DefaultFluidRendererMixin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ private void onIsFullBlockFluidOccluded(BlockAndTintGetter world,
4949
BlockPos pos, Direction dir, BlockState state, FluidState fluid,
5050
CallbackInfoReturnable<Boolean> cir)
5151
{
52-
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
52+
// Note: the null BlockPos is here to skip the "exposed only" check
53+
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, null);
5354
EventManager.fire(event);
5455

5556
if(event.isRendered() != null)
@@ -71,7 +72,8 @@ private void onIsSideExposed(BlockAndTintGetter world, int x, int y, int z,
7172
BlockPos pos = new BlockPos(x, y, z);
7273
BlockState state = world.getBlockState(pos);
7374

74-
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
75+
// Note: the null BlockPos is here to skip the "exposed only" check
76+
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, null);
7577
EventManager.fire(event);
7678

7779
if(event.isRendered() == null)

0 commit comments

Comments
 (0)