From e9d1297c171362485975ab563e10cbcaf07a868c Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 29 Mar 2012 18:38:59 -0400 Subject: [PATCH] Fixed bug where Skull Splitter & Serrated Strikes could be used without permissions. --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/Combat.java | 4 ++-- src/main/java/com/gmail/nossr50/skills/Excavation.java | 2 +- src/main/java/com/gmail/nossr50/skills/Fishing.java | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 8e5f32a07..1550480b6 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -13,6 +13,7 @@ Version 1.3.05-dev = Fixed bug with repairing wooden tools = Fixed bug where spawned wolves only had 8 health. = Fixed bug where rare Treasures from Excavation were dropping too often + = Fixed bug where Skull Splitter & Serrated Strikes could be used without permissions. ! Changed Tree Feller to account for ability durability loss but not leaves. ! Changed bypass node for Arcane Forging to not default to true for OPs diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index a9a5755c5..19e15da93 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -65,7 +65,7 @@ public class Combat { Swords.bleedCheck(attacker, target, plugin); } - if (PPa.getAbilityMode(AbilityType.SERRATED_STRIKES)) { + if (PPa.getAbilityMode(AbilityType.SERRATED_STRIKES) && mcPermissions.getInstance().serratedStrikes(attacker)) { applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.SWORDS); } @@ -84,7 +84,7 @@ public class Combat { Axes.impact(attacker, target, event); } - if (PPa.getAbilityMode(AbilityType.SKULL_SPLIITER)) { + if (PPa.getAbilityMode(AbilityType.SKULL_SPLIITER) && mcPermissions.getInstance().skullSplitter(attacker)) { applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.AXES); } diff --git a/src/main/java/com/gmail/nossr50/skills/Excavation.java b/src/main/java/com/gmail/nossr50/skills/Excavation.java index d21f9ffe4..16586b995 100644 --- a/src/main/java/com/gmail/nossr50/skills/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/Excavation.java @@ -104,7 +104,7 @@ public class Excavation { for (ExcavationTreasure treasure : treasures) { if (skillLevel >= treasure.getDropLevel()) { - if (random.nextDouble() * 100.0d <= treasure.getDropChance()) { + if (random.nextDouble() * 100 <= treasure.getDropChance()) { xp += treasure.getXp(); is.add(treasure.getDrop()); } diff --git a/src/main/java/com/gmail/nossr50/skills/Fishing.java b/src/main/java/com/gmail/nossr50/skills/Fishing.java index c960c209f..96a6203e7 100644 --- a/src/main/java/com/gmail/nossr50/skills/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/Fishing.java @@ -100,7 +100,7 @@ public class Fishing { if (LoadProperties.fishingDrops) { FishingTreasure treasure = rewards.get(random.nextInt(rewards.size())); - if (random.nextDouble() * 100.0d <= treasure.getDropChance()) { + if (random.nextDouble() * 100 <= treasure.getDropChance()) { Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp()); theCatch.setItemStack(treasure.getDrop()); }