Prevent placing blocks above y=255

This commit is contained in:
themode 2020-11-13 03:51:02 +01:00
parent 72d941bc74
commit 0ae656c1f2
2 changed files with 3 additions and 3 deletions

View File

@ -210,7 +210,7 @@ public class PaletteStorage {
8191, 16383, 32767}; 8191, 16383, 32767};
private static void setBlockAt(@NotNull PaletteStorage paletteStorage, int x, int y, int z, short blockId) { private static void setBlockAt(@NotNull PaletteStorage paletteStorage, int x, int y, int z, short blockId) {
if (y < 0) { if (y < 0 || y >= Chunk.CHUNK_SIZE_Y) {
return; return;
} }
@ -255,7 +255,7 @@ public class PaletteStorage {
} }
private static short getBlockAt(@NotNull PaletteStorage paletteStorage, int x, int y, int z) { private static short getBlockAt(@NotNull PaletteStorage paletteStorage, int x, int y, int z) {
if (y < 0) { if (y < 0 || y >= Chunk.CHUNK_SIZE_Y) {
return 0; return 0;
} }

View File

@ -15,7 +15,7 @@ public class CreativeInventoryActionListener {
short slot = packet.slot; short slot = packet.slot;
final ItemStack item = packet.item; final ItemStack item = packet.item;
if (slot != -1) { if (slot != -1) {
// Set item // Set item
slot = (short) PlayerInventoryUtils.convertSlot(slot, PlayerInventoryUtils.OFFSET); slot = (short) PlayerInventoryUtils.convertSlot(slot, PlayerInventoryUtils.OFFSET);