Fix various issues

This commit is contained in:
William committed 2023-03-20 23:23:06 +00:00
1 parent 503898a0ef
commit 054811676d
35 files changed
+236 -243

No files matched your search

@@ -41,6 +41,9 @@ public class Locales {
* @return An {@link Optional} containing the locale corresponding to the id, if it exists
*/
public Optional<String> getRawLocale(@NotNull String localeId) {
if (!rawLocales.containsKey(localeId)) { // debug
return Optional.of(localeId + " (missing locale)"); // debug
} // debug
return Optional.ofNullable(rawLocales.get(localeId)).map(StringEscapeUtils::unescapeJava);
}
@@ -3,6 +3,7 @@ package net.william278.huskhomes.config;
import net.william278.annotaml.YamlComment;
import net.william278.annotaml.YamlFile;
import net.william278.annotaml.YamlKey;
import net.william278.huskhomes.command.Command;
import net.william278.huskhomes.database.Database;
import net.william278.huskhomes.hook.EconomyHook;
import net.william278.huskhomes.hook.MapHook;
@@ -490,8 +491,12 @@ public class Settings {
return warpsOnMap;
}
public List<String> getDisabledCommands() {
return disabledCommands;
public boolean isCommandDisabled(Command type) {
return disabledCommands.stream().anyMatch(disabled -> {
final String command = (disabled.startsWith("/") ? disabled.substring(1) : disabled);
return command.equalsIgnoreCase(type.getName())
|| type.getAliases().stream().anyMatch(alias -> alias.equalsIgnoreCase(command));
});
}
public boolean doBrigadierTabCompletion() {