mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-16 13:11:40 +01:00
Prevent placing blocks above y=255
This commit is contained in:
parent
72d941bc74
commit
0ae656c1f2
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user