From ad62e51ab3b583c7c29a65879d24178cd26cb6dc Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 8 Dec 2021 16:22:06 +0100 Subject: [PATCH] Fix lighting when block is placed in same frame as chunk load --- .../java/com/replaymod/replay/FullReplaySender.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/replaymod/replay/FullReplaySender.java b/src/main/java/com/replaymod/replay/FullReplaySender.java index 36cab830..95b944a5 100644 --- a/src/main/java/com/replaymod/replay/FullReplaySender.java +++ b/src/main/java/com/replaymod/replay/FullReplaySender.java @@ -454,8 +454,14 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend //#if MC>=11400 if (p instanceof ChunkDataS2CPacket) { Runnable doLightUpdates = () -> { - if (mc.world != null) { - LightingProvider provider = mc.world.getChunkManager().getLightingProvider(); + ClientWorld world = mc.world; + if (world != null) { + //#if MC>=11800 + //$$ while (!world.hasNoChunkUpdaters()) { + //$$ world.runQueuedChunkUpdates(); + //$$ } + //#endif + LightingProvider provider = world.getChunkManager().getLightingProvider(); while (provider.hasUpdates()) { provider.doLightUpdates(Integer.MAX_VALUE, true, true); }