Skip to content

Commit

Permalink
update for packetevents
Browse files Browse the repository at this point in the history
  • Loading branch information
AoElite committed Nov 17, 2022
1 parent 7f063ba commit abd942a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ public class PacketWorldReaderEighteen extends BasePacketWorldReader {
// Mojang decided to include lighting in this packet. It's inefficient to read it, so we replace PacketEvents logic.
@Override
public void handleMapChunk(GrimPlayer player, PacketSendEvent event) {
PacketWrapper wrapper = new PacketWrapper(event);
PacketWrapper<?> wrapper = new PacketWrapper<>(event);

int x = wrapper.readInt();
int z = wrapper.readInt();

// Skip past heightmaps
wrapper.readNBT();

BaseChunk[] chunks = new ChunkReader_v1_18().read(null, null, true, false, false, event.getUser().getTotalWorldHeight() >> 4, null, new NetStreamInput(new ByteArrayInputStream(wrapper.readByteArray())));
BaseChunk[] chunks = new ChunkReader_v1_18().read(null,null, null, true, false, false, event.getUser().getTotalWorldHeight() >> 4, null, new NetStreamInput(new ByteArrayInputStream(wrapper.readByteArray())));

// Remove biomes to save memory
for (int i = 0; i < chunks.length; i++) {
Expand Down

0 comments on commit abd942a

Please sign in to comment.