fixes/recommendations from moi

This commit is contained in:
Artemis-the-gr8 2022-05-29 19:16:38 +02:00
parent aea640a947
commit 07668c8010
3 changed files with 9 additions and 4 deletions

View File

@ -59,7 +59,6 @@ public class TabCompleter implements org.bukkit.command.TabCompleter {
else if (args[args.length-2].equalsIgnoreCase("player")) {
if (args.length >= 3 && EnumHandler.getEntityStatNames().contains(args[args.length-3].toLowerCase())) {
tabSuggestions = commandOptions;
}
else {
tabSuggestions = offlinePlayerHandler.getOfflinePlayerNames().stream().filter(player ->

View File

@ -105,7 +105,13 @@ public class ConfigHandler {
return false;
}
/*private String getData(boolean topStat, boolean isStyle, String statName){
ConfigurationSection section = getRelevantSection(topStat, isStyle);
return section != null ? section.getString(statName) : null;
}*/
public String getStatNameFormatting(boolean topStat, boolean isStyle) {
//return getData(topStat, isStyle, "stat-names");
ConfigurationSection section = getRelevantSection(topStat, isStyle);
return section != null ? section.getString("stat-names") : null;
}
@ -121,6 +127,7 @@ public class ConfigHandler {
}
public String getListNumberFormatting(boolean isStyle) {
//return getData(true, isStyle, "list-numbers");
ConfigurationSection section = getRelevantSection(true, isStyle);
return section != null ? section.getString("list-numbers") : null;
}
@ -154,6 +161,5 @@ public class ConfigHandler {
config = plugin.getConfig();
plugin.saveDefaultConfig();
configFile = new File(plugin.getDataFolder(), "config.yml");
}
}

View File

@ -71,7 +71,7 @@ public class EnumHandler {
return EntityType.valueOf(entityName.toUpperCase());
}
catch (IllegalArgumentException e) {
throw new IllegalArgumentException(entityName + " is not a valid EntityType!");
throw new IllegalArgumentException(entityName + " is not a valid EntityType! ", e.getCause());
}
}
@ -160,7 +160,7 @@ public class EnumHandler {
return subStatEntry != null && isBlock(subStatEntry);
}
case UNTYPED -> {
return subStatEntry==null;
return subStatEntry == null;
}
default -> {
return false;