mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Added onBlockPlace event
Added onBlockPlace event to prevent block placements (by players) above the pedestals
This commit is contained in:
parent
1749ae4131
commit
e57eec9b14
@ -179,5 +179,17 @@ public class AncientAltarListener implements Listener {
|
||||
e.getItem().remove();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockPlace(BlockPlaceEvent e) {
|
||||
if(e.isCancelled()) return;
|
||||
Block b = e.getBlockPlaced().getRelative(0, -1, 0);
|
||||
SlimefunItem item = BlockStorage.check(b);
|
||||
if(item == null) return;
|
||||
if(item.getName().equalsIgnoreCase("ANCIENT_PEDESTAL")) {
|
||||
Messages.local.sendTranslation(e.getPlayer(), "messages.cant-place", true);
|
||||
e.setCancelled(true);
|
||||
} else return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user