Fixed bug where fired arrows could raise skill levels other than Archery

This commit is contained in:
GJ 2013-02-13 12:25:57 -05:00
parent 8312570825
commit 0879e1f326
2 changed files with 5 additions and 4 deletions

View File

@ -32,6 +32,7 @@ Version 1.4.00-dev
+ Added "Chinese (Taiwan)" localization files (zh_TW) + Added "Chinese (Taiwan)" localization files (zh_TW)
+ Added '/hardcore' and '/vampirism' commands for toggling these modes on or off. + 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 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 /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 the durability of non-armor equipped blocks
= Fixed Impact reducing improperly the durability of armors (as a consequence it is now more effective) = Fixed Impact reducing improperly the durability of armors (as a consequence it is now more effective)

View File

@ -72,7 +72,7 @@ public final class CombatTools {
Material heldItemType = heldItem.getType(); Material heldItemType = heldItem.getType();
DamageCause damageCause = event.getCause(); DamageCause damageCause = event.getCause();
if (ItemChecks.isSword(heldItem) && damageCause != DamageCause.MAGIC) { if (ItemChecks.isSword(heldItem) && damageCause == DamageCause.ENTITY_ATTACK) {
if (targetIsPlayer || targetIsTamedPet) { if (targetIsPlayer || targetIsTamedPet) {
if (!Swords.pvpEnabled) { if (!Swords.pvpEnabled) {
return; return;
@ -103,7 +103,7 @@ public final class CombatTools {
startGainXp(mcMMOPlayer, target, SkillType.SWORDS); 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 (targetIsPlayer || targetIsTamedPet) {
if (!Axes.pvpEnabled) { if (!Axes.pvpEnabled) {
return; return;
@ -141,7 +141,7 @@ public final class CombatTools {
startGainXp(mcMMOPlayer, target, SkillType.AXES); 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 (targetIsPlayer || targetIsTamedPet) {
if (!configInstance.getUnarmedPVP()) { if (!configInstance.getUnarmedPVP()) {
return; return;
@ -176,7 +176,7 @@ public final class CombatTools {
startGainXp(mcMMOPlayer, target, SkillType.UNARMED); 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 tamingManager = new TamingManager(Users.getPlayer(player));
tamingManager.beastLore(target); tamingManager.beastLore(target);
event.setCancelled(true); event.setCancelled(true);