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

Dieser Commit ist enthalten in:
Antony Riley 2015-07-18 23:06:31 +03:00 committet von md_5
Ursprung 09ddd9b35e
Commit 87b9f46d72

Datei anzeigen

@ -88,7 +88,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
char[] secBlkID = new char[4096]; // Allocate block ID bytes char[] secBlkID = new char[4096]; // Allocate block ID bytes
for (int i = 0; i < secBlkID.length; i++) { 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()); secBlkID[i] = (char) Block.d.b(b.getBlockData());
} }
csect[sec] = new ChunkSection(sec << 4, true, secBlkID); csect[sec] = new ChunkSection(sec << 4, true, secBlkID);
@ -125,7 +125,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
csbytes = cs.getIdArray(); 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()); csbytes[(cy << 8) | (cz << 4) | cx] = (char) Block.d.b(b.getBlockData());
} }
} }