Fixed Beast Lore not working, fixes #771

This commit is contained in:
bm01 2013-03-03 14:21:19 +01:00
parent d3ec976f44
commit b779258d69
2 changed files with 13 additions and 10 deletions

View File

@ -16,6 +16,7 @@ Version 1.4.01-dev
= Fixed bug where the wrong flag was being set when taking damage
= Fixed bug where the PTP cooldown was set improperly
= Fixed bug where ptp permissions weren't being handled properly
= Fixed bug where Beast Lore wouldn't work
Version 1.4.00
+ Added new Child Skill - Smelting!

View File

@ -61,14 +61,19 @@ public final class CombatUtils {
return;
}
if (target instanceof Tameable && isFriendlyPet(player, (Tameable) target)) {
ItemStack heldItem = player.getItemInHand();
if (target instanceof Tameable) {
if (heldItem.getType() == Material.BONE && Permissions.beastLore(player)) {
SkillManagerStore.getInstance().getTamingManager(player.getName()).beastLore(target);
event.setCancelled(true);
return;
}
ItemStack heldItem = player.getItemInHand();
Material heldItemType = heldItem.getType();
if (ItemUtils.isSword(heldItem)) {
else if (isFriendlyPet(player, (Tameable) target)) {
return;
}
}
else if (ItemUtils.isSword(heldItem)) {
if (targetIsPlayer || targetIsTamedPet) {
if (!SkillType.SWORDS.getPVPEnabled()) {
return;
@ -133,7 +138,7 @@ public final class CombatUtils {
startGainXp(axeManager.getMcMMOPlayer(), target, SkillType.AXES);
}
}
else if (heldItemType == Material.AIR) {
else if (heldItem.getType() == Material.AIR) {
if (targetIsPlayer || targetIsTamedPet) {
if (!SkillType.UNARMED.getPVPEnabled()) {
return;
@ -173,9 +178,6 @@ public final class CombatUtils {
startGainXp(mcMMOPlayer, target, SkillType.UNARMED);
}
}
else if (heldItemType == Material.BONE && target instanceof Tameable && Permissions.beastLore(player)) {
SkillManagerStore.getInstance().getTamingManager(player.getName()).beastLore(target);
}
}
switch (damager.getType()) {