[Bleeding] Added Help API. Addresses BUKKIT-863
By: rmichela <deltahat@gmail.com>
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
package org.bukkit.command;
|
||||
|
||||
import org.bukkit.command.defaults.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Iterator;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import static org.bukkit.util.Java15Compat.Arrays_copyOfRange;
|
||||
|
||||
@@ -143,6 +139,10 @@ public class SimpleCommandMap implements CommandMap {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Set<VanillaCommand> getFallbackCommands() {
|
||||
return Collections.unmodifiableSet(fallbackCommands);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@@ -156,9 +156,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
|
||||
String sentCommandLabel = args[0].toLowerCase();
|
||||
Command target = getCommand(sentCommandLabel);
|
||||
if (target == null) {
|
||||
target = getFallback(commandLine.toLowerCase());
|
||||
}
|
||||
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -186,7 +184,15 @@ public class SimpleCommandMap implements CommandMap {
|
||||
}
|
||||
|
||||
public Command getCommand(String name) {
|
||||
return knownCommands.get(name.toLowerCase());
|
||||
Command target = knownCommands.get(name.toLowerCase());
|
||||
if (target == null) {
|
||||
target = getFallback(name);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
public Collection<Command> getCommands() {
|
||||
return knownCommands.values();
|
||||
}
|
||||
|
||||
public void registerServerAliases() {
|
||||
|
||||
Reference in New Issue
Block a user