mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 13:36:16 +01:00
Implemented new alias system
This commit is contained in:
parent
e73b10cf9e
commit
0a3b89c8f8
@ -551,13 +551,21 @@ public final class CraftServer implements Server {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getCommandAliases() {
|
public Map<String, String[]> getCommandAliases() {
|
||||||
ConfigurationNode node = configuration.getNode("aliases");
|
ConfigurationNode node = configuration.getNode("aliases");
|
||||||
Map<String, String> result = new HashMap<String, String>();
|
Map<String, String[]> result = new HashMap<String, String[]>();
|
||||||
|
|
||||||
if (node != null) {
|
if (node != null) {
|
||||||
for (String key : node.getKeys()) {
|
for (String key : node.getKeys()) {
|
||||||
result.put(key, node.getString(key));
|
List<String> commands = new ArrayList<String>();
|
||||||
|
|
||||||
|
if (node.getProperty(key) instanceof List) {
|
||||||
|
commands = node.getStringList(key, null);
|
||||||
|
} else {
|
||||||
|
commands.add(node.getString(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
result.put(key, commands.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user