diff --git a/resources/plugin.yml b/resources/plugin.yml index ba0596fa..f00028dc 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -92,10 +92,13 @@ permissions: children: brewery.openbarrel.small: true brewery.openbarrel.big: true + brewery.openbarrel.mc: true brewery.openbarrel.small: description: Allow to open small Barrels brewery.openbarrel.big: description: Allow to open big Barrels + brewery.openbarrel.mc: + description: Allow to open Minecraft Barrels # -- Cauldron -- brewery.cauldron.time: diff --git a/src/com/dre/brewery/listeners/PlayerListener.java b/src/com/dre/brewery/listeners/PlayerListener.java index 082ef436..66dca73f 100644 --- a/src/com/dre/brewery/listeners/PlayerListener.java +++ b/src/com/dre/brewery/listeners/PlayerListener.java @@ -51,6 +51,13 @@ public void onPlayerInteract(PlayerInteractEvent event) { } return; } + if (P.use1_14 && type == Material.BARREL) { + if (!player.hasPermission("brewery.openbarrel.mc")) { + event.setCancelled(true); + P.p.msg(player, P.p.languageReader.get("Error_NoPermissions")); + } + return; + } // Do not process Off Hand for Barrel interaction if (P.use1_9 && event.getHand() != EquipmentSlot.HAND) {