From 881f2c023eb4b1da4dc59cb62d735f58f26d64e9 Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 25 Jun 2012 08:44:05 -0400 Subject: [PATCH] Added permission node for Iron Grip --- .../com/gmail/nossr50/skills/unarmed/UnarmedManager.java | 4 +++- src/main/java/com/gmail/nossr50/util/Permissions.java | 4 ++++ src/main/resources/plugin.yml | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java index 0d4683ecc..952f6d1f7 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -87,7 +87,9 @@ public class UnarmedManager { * @return true if the defender was not disarmed, false otherwise */ private boolean hasIronGrip(Player defender) { - //TODO: Add permission for Iron Grip + if (!permissionsInstance.ironGrip(defender)) { + return false; + } IronGripEventHandler eventHandler = new IronGripEventHandler(this, defender); diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/Permissions.java index 4b2b3b942..528d0d51a 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/src/main/java/com/gmail/nossr50/util/Permissions.java @@ -228,6 +228,10 @@ public class Permissions { return player.hasPermission("mcmmo.ability.unarmed.deflect"); } + public boolean ironGrip(Player player) { + return player.hasPermission("mcmmo.ability.unarmed.irongrip"); + } + /* * MCMMO.ABILITY.ARCHERY.* */ diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7d7e454f9..e89d8a1bd 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -5,7 +5,7 @@ description: mcMMO takes core Minecraft game mechanics and expands them to add a author: nossr50 authors: [NuclearW, gmcferrin, bm01] website: http://forums.bukkit.org/threads/rpg-mech-mcmmo-v1-3-05-rpg-addiction-redefined-multi-lingual-1-2-5-r1-0.68601/ - + main: com.gmail.nossr50.mcMMO softdepend: [Spout] load: STARTUP @@ -349,6 +349,7 @@ permissions: mcmmo.ability.unarmed.disarm: true mcmmo.ability.unarmed.berserk: true mcmmo.ability.unarmed.deflect: true + mcmmo.ability.unarmed.irongrip: true mcmmo.ability.unarmed.bonusdamage: description: Allows bonus damage from Unarmed mcmmo.ability.unarmed.disarm: @@ -357,6 +358,8 @@ permissions: description: Allows access to the Berserker ability mcmmo.ability.unarmed.deflect: description: Allows access to the Deflect ability + mcmmo.ability.unarmed.irongrip: + description: Allows access to the Iron Grip ability mcmmo.ability.archery.*: description: Allows access to all Archery abilities children: