use of de.Keyle.MyPet.api.entity.LeashFlag in project MyPet by xXKeyleXx.
the class CommandPetType method onCommand.
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if (args.length < 1) {
return false;
}
String lang = "en";
if (commandSender instanceof Player) {
lang = MyPetApi.getPlatformHelper().getPlayerLanguage((Player) commandSender);
}
try {
MyPetType myPetType = MyPetType.byName(args[0]);
String leashFlagString = "";
for (LeashFlag leashFlag : MyPetApi.getMyPetInfo().getLeashFlags(myPetType)) {
leashFlagString += leashFlag.name() + ", ";
}
leashFlagString = leashFlagString.substring(0, leashFlagString.lastIndexOf(","));
commandSender.sendMessage(Translation.getString("Name.LeashFlag", lang) + ": " + leashFlagString);
String foodString = "";
for (ConfigItem material : MyPetApi.getMyPetInfo().getFood(myPetType)) {
foodString += WordUtils.capitalizeFully(MyPetApi.getPlatformHelper().getMaterialName(material.getItem().getTypeId()).replace("_", " ")) + ", ";
}
foodString = foodString.substring(0, foodString.lastIndexOf(","));
commandSender.sendMessage(Translation.getString("Name.Food", lang) + ": " + foodString);
commandSender.sendMessage(Translation.getString("Name.HP", lang) + ": " + MyPetApi.getMyPetInfo().getStartHP(myPetType));
} catch (MyPetTypeNotFoundException e) {
commandSender.sendMessage(Translation.getString("Message.Command.PetType.Unknown", lang));
}
return true;
}
Aggregations