mirror of
https://github.com/itHotL/PlayerStats.git
synced 2024-11-26 12:36:16 +01:00
fixes/recommendations from moi
This commit is contained in:
parent
aea640a947
commit
07668c8010
@ -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 ->
|
||||
|
@ -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");
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user