From 0545ed434d70db54055ed309471dd3be8048b23b Mon Sep 17 00:00:00 2001 From: bm01 Date: Sat, 19 Jan 2013 20:44:51 +0100 Subject: [PATCH] Removed unnecessary calls --- .../com/gmail/nossr50/skills/gathering/Excavation.java | 2 +- .../com/gmail/nossr50/skills/gathering/WoodCutting.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java b/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java index 55ec05f31..39e6d67f6 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Excavation.java @@ -128,7 +128,7 @@ public class Excavation { if (player == null) return; - Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage()); + Skills.abilityDurabilityLoss(player.getItemInHand(), Misc.toolDurabilityLoss); if (!mcMMO.placeStore.isTrue(block) && Misc.blockBreakSimulate(block, player, true)) { FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player); diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java index 547e298bb..7677a5338 100644 --- a/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java @@ -492,7 +492,7 @@ public class WoodCutting { mcMMO.p.getServer().getPluginManager().callEvent(armswing); if (Config.getInstance().getWoodcuttingRequiresTool()) { - Skills.abilityDurabilityLoss(player.getItemInHand(), Config.getInstance().getAbilityToolDamage()); + Skills.abilityDurabilityLoss(player.getItemInHand(), Misc.toolDurabilityLoss); } if (mcMMO.spoutEnabled) { @@ -503,9 +503,9 @@ public class WoodCutting { private static int durabilityLossCalulate(ArrayList toBeFelled, int level) { int durabilityLoss = 0; for (Block x : toBeFelled) { - if (Misc.getRandom().nextInt(level + 1) > 0) {}//Don't add durabilityLoss, because Unbreaking enchantment does it's work. - else if (x.getType().equals(Material.LOG) || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLogBlock(x))) { - durabilityLoss = durabilityLoss + Config.getInstance().getAbilityToolDamage(); + if (Misc.getRandom().nextInt(level + 1) > 0) {}//Don't add durabilityLoss, because Unbreaking enchantment does it's work. + else if (x.getType().equals(Material.LOG) || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLogBlock(x))) { + durabilityLoss += Misc.toolDurabilityLoss; } }