From 0879e1f32639ca8361cfa9b076472ac92fbb0357 Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 13 Feb 2013 12:25:57 -0500 Subject: [PATCH] Fixed bug where fired arrows could raise skill levels other than Archery --- Changelog.txt | 1 + .../com/gmail/nossr50/skills/utilities/CombatTools.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 090d58fdf..5dff86f4f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -32,6 +32,7 @@ Version 1.4.00-dev + Added "Chinese (Taiwan)" localization files (zh_TW) + Added '/hardcore' and '/vampirism' commands for toggling these modes on or off. = Fixed bug where splash potions could raise a player's unarmed level + = Fixed bug where fired arrows could raise skill levels other than Archery = Fixed /ptp telporting the target to the player, rather than the other way around. = Fixed Impact reducing the durability of non-armor equipped blocks = Fixed Impact reducing improperly the durability of armors (as a consequence it is now more effective) diff --git a/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java b/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java index 9b36770e7..ca4c05b6f 100644 --- a/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java +++ b/src/main/java/com/gmail/nossr50/skills/utilities/CombatTools.java @@ -72,7 +72,7 @@ public final class CombatTools { Material heldItemType = heldItem.getType(); DamageCause damageCause = event.getCause(); - if (ItemChecks.isSword(heldItem) && damageCause != DamageCause.MAGIC) { + if (ItemChecks.isSword(heldItem) && damageCause == DamageCause.ENTITY_ATTACK) { if (targetIsPlayer || targetIsTamedPet) { if (!Swords.pvpEnabled) { return; @@ -103,7 +103,7 @@ public final class CombatTools { startGainXp(mcMMOPlayer, target, SkillType.SWORDS); } } - else if (ItemChecks.isAxe(heldItem) && damageCause != DamageCause.MAGIC) { + else if (ItemChecks.isAxe(heldItem) && damageCause == DamageCause.ENTITY_ATTACK) { if (targetIsPlayer || targetIsTamedPet) { if (!Axes.pvpEnabled) { return; @@ -141,7 +141,7 @@ public final class CombatTools { startGainXp(mcMMOPlayer, target, SkillType.AXES); } } - else if (heldItemType == Material.AIR && damageCause != DamageCause.MAGIC) { + else if (heldItemType == Material.AIR && damageCause == DamageCause.ENTITY_ATTACK) { if (targetIsPlayer || targetIsTamedPet) { if (!configInstance.getUnarmedPVP()) { return; @@ -176,7 +176,7 @@ public final class CombatTools { startGainXp(mcMMOPlayer, target, SkillType.UNARMED); } } - else if (heldItemType == Material.BONE && target instanceof Tameable && Permissions.beastLore(player) && damageCause != DamageCause.MAGIC) { + else if (heldItemType == Material.BONE && target instanceof Tameable && Permissions.beastLore(player) && damageCause == DamageCause.ENTITY_ATTACK) { TamingManager tamingManager = new TamingManager(Users.getPlayer(player)); tamingManager.beastLore(target); event.setCancelled(true);