Use readableBytes

This commit is contained in:
creeper123123321 2019-05-10 16:02:17 -03:00
parent 4d16dbf76f
commit a51f347371
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1

View File

@ -55,13 +55,12 @@ public class Chunk1_13Type extends PartialType<Chunk, ClientWorld> {
int[] biomeData = groundUp ? new int[256] : null;
if (groundUp) {
try {
if (data.readableBytes() >= 256 * 4) {
for (int i = 0; i < 256; i++) {
biomeData[i] = data.readInt();
}
} catch (IndexOutOfBoundsException e) {
// Some plugin isn't sending biome data while groundUp is true, see #1312
Via.getPlatform().getLogger().log(Level.WARNING, "IndexOutOfBoundsException while trying to read biome data", e);
} else {
Via.getPlatform().getLogger().log(Level.WARNING, "Chunk x="+ chunkX + " z=" + chunkZ + " doesn't have biome data!");
}
}