Add min y check

This commit is contained in:
nucker 2023-01-11 18:31:52 +00:00
parent 68500bf0d0
commit 0ce77673a9

View File

@ -90,7 +90,8 @@ public class BlockPlacementListener {
final int offsetZ = blockFace == BlockFace.NORTH ? -1 : blockFace == BlockFace.SOUTH ? 1 : 0;
final Point placementPosition = blockPosition.add(offsetX, offsetY, offsetZ);
if(placementPosition.y() >= instance.getDimensionType().getMaxY()) return;
if(placementPosition.y() >= instance.getDimensionType().getMaxY()
|| placementPosition.y() <= instance.getDimensionType().getMinY()) return;
if (!canPlaceBlock) {
// Send a block change with the real block in the instance to keep the client in sync,