Move check above placement check

This commit is contained in:
nucker 2023-01-05 18:19:39 +00:00
parent 6ca2be1067
commit 4dc7d5972f

View File

@ -129,10 +129,11 @@ public class BlockPlacementListener {
return; return;
} }
if(placementPosition.y() >= BLOCK_HEIGHT) return;
// BlockPlacementRule check // BlockPlacementRule check
Block resultBlock = playerBlockPlaceEvent.getBlock(); Block resultBlock = playerBlockPlaceEvent.getBlock();
final BlockPlacementRule blockPlacementRule = BLOCK_MANAGER.getBlockPlacementRule(resultBlock); final BlockPlacementRule blockPlacementRule = BLOCK_MANAGER.getBlockPlacementRule(resultBlock);
if(placementPosition.y() >= BLOCK_HEIGHT) return;
if (blockPlacementRule != null) { if (blockPlacementRule != null) {
// Get id from block placement rule instead of the event // Get id from block placement rule instead of the event
resultBlock = blockPlacementRule.blockPlace(instance, resultBlock, blockFace, blockPosition, player); resultBlock = blockPlacementRule.blockPlace(instance, resultBlock, blockFace, blockPosition, player);