mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -07:00
@@ -102,6 +102,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
||||
*
|
||||
* @return Plugin that owns this command
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
public Plugin getPlugin() {
|
||||
return owningPlugin;
|
||||
|
@@ -45,6 +45,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void registerAll(@NotNull String fallbackPrefix, @NotNull List<Command> commands) {
|
||||
if (commands != null) {
|
||||
for (Command c : commands) {
|
||||
@@ -56,6 +57,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean register(@NotNull String fallbackPrefix, @NotNull Command command) {
|
||||
return register(command.getName(), fallbackPrefix, command);
|
||||
}
|
||||
@@ -63,6 +65,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
|
||||
label = label.toLowerCase(java.util.Locale.ENGLISH).trim();
|
||||
fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim();
|
||||
@@ -125,6 +128,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean dispatch(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException {
|
||||
String[] args = commandLine.split(" ");
|
||||
|
||||
@@ -152,6 +156,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void clearCommands() {
|
||||
for (Map.Entry<String, Command> entry : knownCommands.entrySet()) {
|
||||
entry.getValue().unregister(this);
|
||||
@@ -160,17 +165,20 @@ public class SimpleCommandMap implements CommandMap {
|
||||
setDefaultCommands();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Command getCommand(@NotNull String name) {
|
||||
Command target = knownCommands.get(name.toLowerCase(java.util.Locale.ENGLISH));
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine) {
|
||||
return tabComplete(sender, cmdLine, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
|
Reference in New Issue
Block a user