mirror of
https://github.com/aikar/commands.git
synced 2026-06-04 16:12:17 +00:00
Use per-platform Locales classes
This commit is contained in:
@@ -46,11 +46,12 @@ public class SpongeCommandManager extends CommandManager {
|
||||
protected SpongeCommandContexts contexts;
|
||||
protected SpongeCommandCompletions completions;
|
||||
private Timing commandTiming;
|
||||
protected SpongeLocales locales;
|
||||
|
||||
public SpongeCommandManager(PluginContainer plugin) {
|
||||
this.plugin = plugin;
|
||||
String pluginName = "acf-" + plugin.getName();
|
||||
this.locales.addMessageBundles("acf-minecraft", pluginName, pluginName.toLowerCase());
|
||||
getLocales().addMessageBundles("acf-minecraft", pluginName, pluginName.toLowerCase());
|
||||
this.commandTiming = Timings.of(plugin, "Commands");
|
||||
|
||||
this.formatters.put(MessageType.ERROR, new SpongeMessageFormatter(TextColors.RED, TextColors.YELLOW, TextColors.RED));
|
||||
@@ -79,6 +80,14 @@ public class SpongeCommandManager extends CommandManager {
|
||||
return completions;
|
||||
}
|
||||
|
||||
@Override
|
||||
SpongeLocales getLocales() {
|
||||
if (this.locales == null) {
|
||||
this.locales = new SpongeLocales(this);
|
||||
}
|
||||
return locales;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRegisteredCommands() {
|
||||
return !registeredCommands.isEmpty();
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package co.aikar.commands;
|
||||
|
||||
public class SpongeLocales extends Locales{
|
||||
SpongeLocales(SpongeCommandManager manager) {
|
||||
super(manager);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user