SPIGOT-1060: Allow custom generators to use block ids > 127 with bytes.

This commit is contained in:
Antony Riley 2015-07-18 23:06:31 +03:00 committed by md_5
parent 09ddd9b35e
commit 87b9f46d72

View File

@ -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());
}
}