From 1fc3c8fab23d100599703b7551d4d8a11604b3a5 Mon Sep 17 00:00:00 2001 From: GJ Date: Sun, 3 Mar 2013 15:22:40 -0500 Subject: [PATCH] AnimalTamer already has a getName() method. --- .../gmail/nossr50/skills/taming/Taming.java | 19 ------------------- .../nossr50/skills/taming/TamingManager.java | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/taming/Taming.java b/src/main/java/com/gmail/nossr50/skills/taming/Taming.java index 2f15da2dd..a6e312680 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/Taming.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/Taming.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.skills.taming; import org.bukkit.EntityEffect; -import org.bukkit.OfflinePlayer; import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -71,24 +70,6 @@ public class Taming { wolf.playEffect(EntityEffect.WOLF_HEARTS); } - /** - * Get the name of a tameable animal's owner. - * - * @return the name of the animal's owner - */ - protected static String getOwnerName(Tameable beast) { - AnimalTamer tamer = beast.getOwner(); - - if (tamer instanceof Player) { - return ((Player) tamer).getName(); - } - else if (tamer instanceof OfflinePlayer) { - return ((OfflinePlayer) tamer).getName(); - } - - return "Unknown Master"; - } - protected static String getCallOfTheWildFailureMessage(EntityType type) { switch (type) { case OCELOT: diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index 48e922e92..e45343127 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -133,7 +133,7 @@ public class TamingManager extends SkillManager { String message = LocaleLoader.getString("Combat.BeastLore") + " "; if (beast.isTamed()) { - message = message.concat(LocaleLoader.getString("Combat.BeastLoreOwner", Taming.getOwnerName(beast)) + " "); + message = message.concat(LocaleLoader.getString("Combat.BeastLoreOwner", beast.getOwner().getName()) + " "); } message = message.concat(LocaleLoader.getString("Combat.BeastLoreHealth", target.getHealth(), target.getMaxHealth()));