Change y to be from the dimension

This commit is contained in:
nucker 2023-01-05 21:27:05 +00:00
parent 4dc7d5972f
commit ae454a7402

View File

@ -28,7 +28,6 @@ import net.minestom.server.utils.validate.Check;
public class BlockPlacementListener { public class BlockPlacementListener {
private static final BlockManager BLOCK_MANAGER = MinecraftServer.getBlockManager(); private static final BlockManager BLOCK_MANAGER = MinecraftServer.getBlockManager();
private static final double BLOCK_HEIGHT = 320.0;
public static void listener(ClientPlayerBlockPlacementPacket packet, Player player) { public static void listener(ClientPlayerBlockPlacementPacket packet, Player player) {
final PlayerInventory playerInventory = player.getInventory(); final PlayerInventory playerInventory = player.getInventory();
@ -129,7 +128,7 @@ public class BlockPlacementListener {
return; return;
} }
if(placementPosition.y() >= BLOCK_HEIGHT) return; if(placementPosition.y() >= instance.getDimensionType().getMaxY()) return;
// BlockPlacementRule check // BlockPlacementRule check
Block resultBlock = playerBlockPlaceEvent.getBlock(); Block resultBlock = playerBlockPlaceEvent.getBlock();