From 67fd45ef259222fe296f546733fa3475e78fc3ad Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 21 Jan 2013 19:36:15 -0500 Subject: [PATCH] Avoid a few unnecessary calls. --- .../com/gmail/nossr50/skills/unarmed/DisarmEventHandler.java | 4 +--- .../com/gmail/nossr50/skills/unarmed/UnarmedManager.java | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/DisarmEventHandler.java b/src/main/java/com/gmail/nossr50/skills/unarmed/DisarmEventHandler.java index c00c5a102..aa3343e47 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/DisarmEventHandler.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/DisarmEventHandler.java @@ -19,8 +19,6 @@ public class DisarmEventHandler { this.manager = manager; this.defender = defender; this.inHand = defender.getItemInHand(); - - calculateSkillModifier(); } protected boolean isHoldingItem() { @@ -31,7 +29,7 @@ public class DisarmEventHandler { this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Unarmed.DISARM_MAX_BONUS_LEVEL); } - protected void sendAbilityMessage() { + private void sendAbilityMessage() { defender.sendMessage(LocaleLoader.getString("Skills.Disarmed")); } 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 839afdb74..9357d2a6e 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -19,10 +19,7 @@ public class UnarmedManager extends SkillManager { * @param defender The defending player */ public void disarmCheck(Player defender) { - if (player == null) - return; - - if (!Permissions.disarm(player)) { + if (Misc.isNPC(player) || !Permissions.disarm(player)) { return; }