From 12385556503531cb0d469f30a1f6d86cec0d628a Mon Sep 17 00:00:00 2001 From: SamB440 Date: Thu, 22 Aug 2024 14:56:38 +0100 Subject: [PATCH] Workaround packetevents User#getTotalWorldHeight being wrong --- .../packets/worldreader/PacketWorldReaderEighteen.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ac/grim/grimac/events/packets/worldreader/PacketWorldReaderEighteen.java b/src/main/java/ac/grim/grimac/events/packets/worldreader/PacketWorldReaderEighteen.java index d6c87cc501..6c25749c39 100644 --- a/src/main/java/ac/grim/grimac/events/packets/worldreader/PacketWorldReaderEighteen.java +++ b/src/main/java/ac/grim/grimac/events/packets/worldreader/PacketWorldReaderEighteen.java @@ -6,7 +6,6 @@ import com.github.retrooper.packetevents.protocol.world.chunk.BaseChunk; import com.github.retrooper.packetevents.protocol.world.chunk.impl.v_1_18.Chunk_v1_18; import com.github.retrooper.packetevents.protocol.world.chunk.reader.impl.ChunkReader_v1_18; -import com.github.retrooper.packetevents.protocol.world.dimension.DimensionTypes; import com.github.retrooper.packetevents.wrapper.PacketWrapper; import java.io.ByteArrayInputStream; @@ -24,9 +23,9 @@ public void handleMapChunk(GrimPlayer player, PacketSendEvent event) { // Skip past heightmaps wrapper.readNBT(); - BaseChunk[] chunks = new ChunkReader_v1_18().read(DimensionTypes.OVERWORLD,null, + BaseChunk[] chunks = new ChunkReader_v1_18().read(player.dimensionType, null, null, true, false, false, - event.getUser().getTotalWorldHeight() >> 4, null, + player.dimensionType.getHeight() >> 4, null, new NetStreamInput(new ByteArrayInputStream(wrapper.readByteArray()))); // Remove biomes to save memory