Skip to content

Commit

Permalink
Workaround packetevents User#getTotalWorldHeight being wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
SamB440 committed Aug 22, 2024
1 parent 104d1ec commit 1238555
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 1238555

Please sign in to comment.