mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
AnimalTamer already has a getName() method.
This commit is contained in:
parent
7c28be5e62
commit
1fc3c8fab2
@ -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:
|
||||
|
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user