Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Add missing version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Earthcomputer committed Aug 29, 2021
1 parent 34f5b89 commit 0d8bc8d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ private void onOnChunkData(ChunkDataS2CPacket packet, CallbackInfo ci) {
}
}

@Inject(method = "onChunkData", at = @At("RETURN"), cancellable = true)
@Inject(method = "onChunkData", at = @At("RETURN"))
private void postChunkData(ChunkDataS2CPacket packet, CallbackInfo ci) {
// 1.8 doesn't send neighboring empty chunks, so we must assume they are empty unless otherwise specified
if (ConnectionInfo.protocolVersion > Protocols.V1_8) {
return;
}

// don't load more empty chunks next to empty chunks, that would cause an infinite loop
WorldChunk chunk = world.getChunk(packet.getX(), packet.getZ());
Expand Down

0 comments on commit 0d8bc8d

Please sign in to comment.