Added MC Barrel Permission #222

This commit is contained in:
Sn0wStorm 2020-04-08 13:52:54 +02:00
parent 44310e0e36
commit e847672b81
2 changed files with 10 additions and 0 deletions

View File

@ -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:

View File

@ -51,6 +51,13 @@ public class PlayerListener implements Listener {
}
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) {