From 87b9f46d72040ca15d8b0bd9008030be962f86ec Mon Sep 17 00:00:00 2001 From: Antony Riley Date: Sat, 18 Jul 2015 23:06:31 +0300 Subject: [PATCH] SPIGOT-1060: Allow custom generators to use block ids > 127 with bytes. --- .../bukkit/craftbukkit/generator/CustomChunkGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index 4e925824e2..9ecdad4540 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -88,7 +88,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { char[] secBlkID = new char[4096]; // Allocate block ID bytes for (int i = 0; i < secBlkID.length; i++) { - Block b = Block.getById(btypes[sec][i]); + Block b = Block.getById(btypes[sec][i] & 0xFF); secBlkID[i] = (char) Block.d.b(b.getBlockData()); } csect[sec] = new ChunkSection(sec << 4, true, secBlkID); @@ -125,7 +125,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { csbytes = cs.getIdArray(); } - Block b = Block.getById(blk); + Block b = Block.getById(blk & 0xFF); csbytes[(cy << 8) | (cz << 4) | cx] = (char) Block.d.b(b.getBlockData()); } }