Переглянути джерело

Fixed NPE with Beast Lore

Fixes #1289
TfT_02 12 роки тому
батько
коміт
bf2e527e72

+ 2 - 0
Changelog.txt

@@ -12,6 +12,8 @@ Version 1.4.07-dev
  + Added new experience curve option. Cumulative curve, calculates experience needed for next level using power level.
  + Added new experience curve option. Cumulative curve, calculates experience needed for next level using power level.
  = Fixed bug with Skull Splitter not finding the locale string
  = Fixed bug with Skull Splitter not finding the locale string
  = Fixed issue where locale strings could cause the scoreboard header to be longer than 16 characters.
  = Fixed issue where locale strings could cause the scoreboard header to be longer than 16 characters.
+ = Fixed a bug with Beast Lore when the entity had no owner but was tamed.
+ = Fixed a bug where AbilityDeactivateEvent would throw an error if the player logged out before his ability ran out.
  ! Improved profile saving
  ! Improved profile saving
  ! Updated localization files
  ! Updated localization files
 
 

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java

@@ -142,7 +142,7 @@ public class TamingManager extends SkillManager {
 
 
         String message = LocaleLoader.getString("Combat.BeastLore") + " ";
         String message = LocaleLoader.getString("Combat.BeastLore") + " ";
 
 
-        if (beast.isTamed()) {
+        if (beast.isTamed() && beast.getOwner() != null) {
             message = message.concat(LocaleLoader.getString("Combat.BeastLoreOwner", beast.getOwner().getName()) + " ");
             message = message.concat(LocaleLoader.getString("Combat.BeastLoreOwner", beast.getOwner().getName()) + " ");
         }
         }