geforkt von Mirrors/Paper
Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
Dieser Commit ist enthalten in:
Ursprung
3e9512a6fc
Commit
76de1e898e
@ -2844,5 +2844,24 @@ public final class CraftServer implements Server {
|
|||||||
DefaultPermissions.registerCorePermissions();
|
DefaultPermissions.registerCorePermissions();
|
||||||
CraftDefaultPermissions.registerCorePermissions();
|
CraftDefaultPermissions.registerCorePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean reloadCommandAliases() {
|
||||||
|
Set<String> removals = getCommandAliases().keySet().stream()
|
||||||
|
.map(key -> key.toLowerCase(java.util.Locale.ENGLISH))
|
||||||
|
.collect(java.util.stream.Collectors.toSet());
|
||||||
|
getCommandMap().getKnownCommands().keySet().removeIf(removals::contains);
|
||||||
|
File file = getCommandsConfigFile();
|
||||||
|
try {
|
||||||
|
commandsConfiguration.load(file);
|
||||||
|
} catch (FileNotFoundException ex) {
|
||||||
|
return false;
|
||||||
|
} catch (IOException | org.bukkit.configuration.InvalidConfigurationException ex) {
|
||||||
|
Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file, ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
commandMap.registerServerAliases();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren