mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 09:06:46 +01:00
Avoid a few unnecessary calls.
This commit is contained in:
parent
7f8beca33c
commit
67fd45ef25
@ -19,8 +19,6 @@ public class DisarmEventHandler {
|
|||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.defender = defender;
|
this.defender = defender;
|
||||||
this.inHand = defender.getItemInHand();
|
this.inHand = defender.getItemInHand();
|
||||||
|
|
||||||
calculateSkillModifier();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isHoldingItem() {
|
protected boolean isHoldingItem() {
|
||||||
@ -31,7 +29,7 @@ public class DisarmEventHandler {
|
|||||||
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Unarmed.DISARM_MAX_BONUS_LEVEL);
|
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Unarmed.DISARM_MAX_BONUS_LEVEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void sendAbilityMessage() {
|
private void sendAbilityMessage() {
|
||||||
defender.sendMessage(LocaleLoader.getString("Skills.Disarmed"));
|
defender.sendMessage(LocaleLoader.getString("Skills.Disarmed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +19,7 @@ public class UnarmedManager extends SkillManager {
|
|||||||
* @param defender The defending player
|
* @param defender The defending player
|
||||||
*/
|
*/
|
||||||
public void disarmCheck(Player defender) {
|
public void disarmCheck(Player defender) {
|
||||||
if (player == null)
|
if (Misc.isNPC(player) || !Permissions.disarm(player)) {
|
||||||
return;
|
|
||||||
|
|
||||||
if (!Permissions.disarm(player)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user