Skip to content

Commit

Permalink
Fix how TintedGlassLightBlockingTest waits for the light engine to up…
Browse files Browse the repository at this point in the history
…date
  • Loading branch information
Alexander01998 committed Jan 27, 2025
1 parent df63466 commit 8bb3524
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ private static void testConfiguration(BlockPos pos, BlockState state,
{
setBlock(pos, state);
waitUntil("block " + state + " is placed at " + pos, mc -> {
return mc.world.getBlockState(pos) == state;
return mc.world.getBlockState(pos) == state
&& !mc.world.getLightingProvider().hasUpdates();
});
assertLightLevel(0, 0, 4, expectedLightLevel);
setBlock(pos, Blocks.TINTED_GLASS.getDefaultState());
Expand All @@ -114,9 +115,7 @@ private static void setBlock(BlockPos pos, BlockState state)
private static void assertLightLevel(int x, int y, int z, int expected)
{
int lightLevel = submitAndGet(mc -> {
BlockPos pos = mc.player.getBlockPos().add(x, y, z);
mc.world.getLightingProvider().checkBlock(pos);
return mc.world.getLightLevel(pos);
return mc.world.getLightLevel(mc.player.getBlockPos().add(x, y, z));
});

if(lightLevel == expected)
Expand Down

0 comments on commit 8bb3524

Please sign in to comment.