- Removal of additional command localization complexity
This commit is contained in:
@@ -125,8 +125,8 @@ public abstract class BaseLocFile implements IConfigSection
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the value. If the localized string is empty,
|
// Returns the localized string if available.
|
||||||
// returns a the key instead which is the default phrase.
|
// If the localized string is empty, returns a the key instead as the default phrase.
|
||||||
public String getKey(String input)
|
public String getKey(String input)
|
||||||
{
|
{
|
||||||
if(localized == null)
|
if(localized == null)
|
||||||
|
|||||||
@@ -36,19 +36,13 @@ public class CommandManager
|
|||||||
if(pair == null || pair.Second == null)
|
if(pair == null || pair.Second == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String key = pair.Second;
|
String[] keys = pair.Second.split(",");
|
||||||
|
|
||||||
if(key.contains(","))
|
for(int i = 0; i < keys.length; ++i)
|
||||||
{
|
{
|
||||||
|
String key = keys[i].trim().toLowerCase();
|
||||||
|
|
||||||
String[] keys = key.split(",");
|
|
||||||
register(keys, command);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
key = key.toLowerCase();
|
|
||||||
command.registeredNames.add(key);
|
command.registeredNames.add(key);
|
||||||
|
|
||||||
Command old = commands.put(key, command);
|
Command old = commands.put(key, command);
|
||||||
|
|
||||||
if(old != null)
|
if(old != null)
|
||||||
@@ -59,12 +53,6 @@ public class CommandManager
|
|||||||
|
|
||||||
GlobalLog.log(LogFilter.Core, "Command registered under key " + key);
|
GlobalLog.log(LogFilter.Core, "Command registered under key " + key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Registers a command under multiple names!
|
|
||||||
public void register(String[] keys, Command command)
|
|
||||||
{
|
|
||||||
for(int i = 0; i < keys.length; ++i)
|
|
||||||
register(new Pair<String, String>(null, keys[i].trim()), command);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calls the command but on a whole new thread!
|
// Calls the command but on a whole new thread!
|
||||||
@@ -74,9 +62,9 @@ public class CommandManager
|
|||||||
if(input == null || !input.isValid())
|
if(input == null || !input.isValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If we haven't already split a multisplit command (or even assessed that),
|
// At this point, verify that the command is enabled. If we don't have any info
|
||||||
// then verify if we even need to register the commands at all. If it's
|
// on if it's enabled or not, we assume it's enabled to prevent broken functionality due
|
||||||
// not enabled, don't register it.
|
// to formatting or casing issues.
|
||||||
if(input.key != null && !commandEnabler.isEnabled(input.key))
|
if(input.key != null && !commandEnabler.isEnabled(input.key))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user