mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +01:00
Prevent players from using bonemeal on grass if they aren't allowed to build in a region
This commit is contained in:
parent
233a2bdbe7
commit
d971389746
@ -382,6 +382,16 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (item.getData().getItemType() == Material.INK_SACK
|
||||
&& item.getData().getData() == 15 // bonemeal
|
||||
&& type == Material.GRASS) {
|
||||
if (!plugin.getGlobalRegionManager().hasBypass(player, world)
|
||||
&& !set.canBuild(localPlayer)) {
|
||||
event.setCancelled(true);
|
||||
event.setUseInteractedBlock(Result.DENY);
|
||||
event.setUseItemInHand(Result.DENY);
|
||||
}
|
||||
}
|
||||
|
||||
if (type == Material.CHEST
|
||||
|| type == Material.JUKEBOX //stores the (arguably) most valuable item
|
||||
|
Loading…
Reference in New Issue
Block a user