From 319a9c20eb4416295e7fb32f0d011ee4ff62ed77 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Thu, 10 Jul 2014 19:19:48 -0500 Subject: Handle uniform block ids greater than 127. Fixes BUKKIT-5686 --- src/main/java/net/minecraft/server/ChunkSection.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java index e33712a4..db1e52c9 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -13,7 +13,7 @@ public class ChunkSection { private NibbleArray emittedLight; private NibbleArray skyLight; // CraftBukkit start - Compact storage - private byte compactId; + private int compactId; private byte compactExtId; private byte compactData; private byte compactEmitted; @@ -125,7 +125,7 @@ public class ChunkSection { // CraftBukkit start - Compact storage if (this.blockIds == null) { this.blockIds = new byte[4096]; - Arrays.fill(this.blockIds, this.compactId); + Arrays.fill(this.blockIds, (byte) (this.compactId & 255)); } // CraftBukkit end @@ -351,7 +351,7 @@ public class ChunkSection { // CraftBukkit start - Compact storage if (this.blockIds == null) { byte[] ids = new byte[4096]; - Arrays.fill(ids, this.compactId); + Arrays.fill(ids, (byte) (this.compactId & 255)); return ids; } // CraftBukkit end @@ -401,7 +401,7 @@ public class ChunkSection { this.blockIds = null; return; } else if (canBeCompact(abyte)) { - this.compactId = abyte[0]; + this.compactId = abyte[0] & 255; return; } // CraftBukkit end -- cgit v1.2.3