diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java index 8204ceea5..a9b3f3780 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaForgetLevelChunkTranslator.java @@ -30,6 +30,7 @@ import com.nukkitx.math.vector.Vector3i; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; +import org.geysermc.geyser.util.ChunkUtils; import java.util.Iterator; @@ -60,5 +61,7 @@ public class JavaForgetLevelChunkTranslator extends PacketTranslator> 4; int chunkZ = position.getZ() >> 4; for (int x = -radius; x <= radius; x++) { for (int z = -radius; z <= radius; z++) { - LevelChunkPacket data = new LevelChunkPacket(); - data.setChunkX(chunkX + x); - data.setChunkZ(chunkZ + z); - data.setSubChunksLength(0); - data.setData(EMPTY_CHUNK_DATA); - data.setCachingEnabled(false); - session.sendUpstreamPacket(data); - - if (forceUpdate) { - Vector3i pos = Vector3i.from(chunkX + x << 4, 80, chunkZ + z << 4); - UpdateBlockPacket blockPacket = new UpdateBlockPacket(); - blockPacket.setBlockPosition(pos); - blockPacket.setDataLayer(0); - blockPacket.setRuntimeId(1); - session.sendUpstreamPacket(blockPacket); - } + sendEmptyChunk(session, chunkX + x, chunkZ + z, forceUpdate); } } }