+ Added localization support for commands

This commit is contained in:
Matthew Cech
2019-04-13 23:54:21 -07:00
parent fbd047849c
commit f00160714a
8 changed files with 340 additions and 190 deletions
+10 -3
View File
@@ -29,9 +29,16 @@ public class CommandManager
// Allows the command manager to keep track of a command.
public void Register(String key, Command command)
{
{
if(key == null)
return;
return;
if(key.contains(","))
{
String[] keys = key.split(",");
Register(keys, command);
return;
}
key = key.toLowerCase();
command.registeredNames.add(key);
@@ -51,7 +58,7 @@ public class CommandManager
public void Register(String[] keys, Command command)
{
for(int i = 0; i < keys.length; ++i)
Register(keys[i], command);
Register(keys[i].trim(), command);
}
// Calls the command but on a whole new thread!