Skip to content

Instantly share code, notes, and snippets.

@Alluseri
Created May 31, 2024 14:12
Show Gist options
  • Save Alluseri/6877e7bd65d3fb45ea95f0be0c77cb47 to your computer and use it in GitHub Desktop.
Save Alluseri/6877e7bd65d3fb45ea95f0be0c77cb47 to your computer and use it in GitHub Desktop.
BTA item/chunk ban fix
public static CompoundTag readCompressedCompoundTag(final DataInputStream dis) throws IOException {
final int length = Short.toUnsignedInt(dis.readShort());
if (length == 0) {
return null;
}
final byte[] data = new byte[length];
dis.readFully(data);
return NbtIo.readCompressed(new ByteArrayInputStream(data));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment