From e68cbdbde2f42546f68c79f59babf69533cd9cb3 Mon Sep 17 00:00:00 2001 From: Moulberry Date: Thu, 28 Sep 2023 16:49:55 +0800 Subject: [PATCH] Add comments --- .../moulberry/axiom/packet/SetBlockBufferPacketListener.java | 2 ++ .../com/moulberry/axiom/packet/SetBlockPacketListener.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/com/moulberry/axiom/packet/SetBlockBufferPacketListener.java b/src/main/java/com/moulberry/axiom/packet/SetBlockBufferPacketListener.java index d75629b..379054b 100644 --- a/src/main/java/com/moulberry/axiom/packet/SetBlockBufferPacketListener.java +++ b/src/main/java/com/moulberry/axiom/packet/SetBlockBufferPacketListener.java @@ -245,8 +245,10 @@ private void applyBlockBuffer(ServerPlayer player, MinecraftServer server, Block chunk.removeBlockEntity(blockPos); } + // Mark block changed world.getChunkSource().blockChanged(blockPos); // todo: maybe simply resend chunk instead of this? + // Update Light if (LightEngine.hasDifferentLightProperties(chunk, blockPos, old, blockState)) { chunk.getSkyLightSources().update(chunk, x, by, z); lightEngine.checkBlock(blockPos); diff --git a/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java b/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java index e90576a..17e30ec 100644 --- a/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java +++ b/src/main/java/com/moulberry/axiom/packet/SetBlockPacketListener.java @@ -187,7 +187,10 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk chunk.removeBlockEntity(blockPos); } + // Mark block changed level.getChunkSource().blockChanged(blockPos); + + // Update Light if (LightEngine.hasDifferentLightProperties(chunk, blockPos, old, blockState)) { chunk.getSkyLightSources().update(chunk, x, by, z); level.getChunkSource().getLightEngine().checkBlock(blockPos);