Преглед изворни кода

Fixed bug where Beast Lore wouldn't work on friendly pets.

Fixes #805
GJ пре 12 година
родитељ
комит
ade9e20cdd
2 измењених фајлова са 5 додато и 4 уклоњено
  1. 1 0
      Changelog.txt
  2. 4 4
      src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java

+ 1 - 0
Changelog.txt

@@ -14,6 +14,7 @@ Version 1.4.03-dev
  = Fixed bug where Fishing was becoming less successful at higher levels
  = Fixed bug with using Salvage on stacked items.
  = Fixed bug where the 'mcmmo.commands.ptp.world.all' was registered twice
+ = Fixed bug where Beast Lore wouldn't work on friendly pets
  ! Moved the Salvage unlock level from config.yml to advanced.yml
  - Removed option to disable Salvage via the config file. This should be handled via permissions instead.
  - Removed the option to use Woodcutting without an axe from the config file.

+ 4 - 4
src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java

@@ -64,10 +64,6 @@ public final class CombatUtils {
             ItemStack heldItem = player.getItemInHand();
 
             if (target instanceof Tameable) {
-                if (isFriendlyPet(player, (Tameable) target)) {
-                    return;
-                }
-
                 if (heldItem.getType() == Material.BONE) {
                     TamingManager tamingManager = mcMMOPlayer.getTamingManager();
 
@@ -77,6 +73,10 @@ public final class CombatUtils {
                         return;
                     }
                 }
+
+                if (isFriendlyPet(player, (Tameable) target)) {
+                    return;
+                }
             }
 
             if (ItemUtils.isSword(heldItem)) {