Skip to content

Commit

Permalink
Added MC Barrel Permission #222
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wStorm committed Apr 8, 2020
1 parent 44310e0 commit e847672
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions src/com/dre/brewery/listeners/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e847672

Please sign in to comment.