mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-17 15:49:17 +01:00
Cleaned up the code slightly to be smaller
This commit is contained in:
parent
9b8279e981
commit
897d6410d2
@ -34,6 +34,7 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand {
|
|||||||
} else {
|
} else {
|
||||||
Enum[] enums = null;
|
Enum[] enums = null;
|
||||||
String enumName = null;
|
String enumName = null;
|
||||||
|
ArrayList<String> enumReturns = new ArrayList<String>();
|
||||||
if (args[0].equalsIgnoreCase("animalcolor") || args[0].equalsIgnoreCase("animalcolors")) {
|
if (args[0].equalsIgnoreCase("animalcolor") || args[0].equalsIgnoreCase("animalcolors")) {
|
||||||
enums = AnimalColor.values();
|
enums = AnimalColor.values();
|
||||||
enumName = "Animal colors";
|
enumName = "Animal colors";
|
||||||
@ -50,21 +51,19 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand {
|
|||||||
enums = Profession.values();
|
enums = Profession.values();
|
||||||
enumName = "Villager professions";
|
enumName = "Villager professions";
|
||||||
} else if (args[0].equalsIgnoreCase("PotionEffect") || args[0].equalsIgnoreCase("PotionEffects")) {
|
} else if (args[0].equalsIgnoreCase("PotionEffect") || args[0].equalsIgnoreCase("PotionEffects")) {
|
||||||
ArrayList<String> potionTypes = new ArrayList<String>();
|
enumName = "Potioneffect types";
|
||||||
for (PotionEffectType potionType : PotionEffectType.values()) {
|
for (PotionEffectType potionType : PotionEffectType.values()) {
|
||||||
if (potionType != null)
|
if (potionType != null)
|
||||||
potionTypes.add(toReadable(potionType.getName()) + ChatColor.RED + "(" + ChatColor.GREEN
|
enumReturns.add(toReadable(potionType.getName()) + ChatColor.RED + "(" + ChatColor.GREEN
|
||||||
+ potionType.getId() + ChatColor.RED + ")");
|
+ potionType.getId() + ChatColor.RED + ")");
|
||||||
}
|
}
|
||||||
sender.sendMessage(ChatColor.RED + "Potioneffect types: " + ChatColor.GREEN
|
|
||||||
+ StringUtils.join(potionTypes, ChatColor.RED + ", " + ChatColor.GREEN));
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
if (enums != null) {
|
if (enums != null) {
|
||||||
ArrayList<String> enumReturns = new ArrayList<String>();
|
|
||||||
for (Enum enumType : enums) {
|
for (Enum enumType : enums) {
|
||||||
enumReturns.add(toReadable(enumType.name()));
|
enumReturns.add(toReadable(enumType.name()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!enumReturns.isEmpty()) {
|
||||||
sender.sendMessage(ChatColor.RED + enumName + ": " + ChatColor.GREEN
|
sender.sendMessage(ChatColor.RED + enumName + ": " + ChatColor.GREEN
|
||||||
+ StringUtils.join(enumReturns, ChatColor.RED + ", " + ChatColor.GREEN));
|
+ StringUtils.join(enumReturns, ChatColor.RED + ", " + ChatColor.GREEN));
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user