mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
+ Velocity 3.x support
This commit is contained in:
@@ -31,6 +31,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.velocitypowered.api.command.CommandMeta;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -133,7 +134,8 @@ public class VelocityCommandManager extends
|
||||
if (force) {
|
||||
proxy.getCommandManager().unregister(commandName);
|
||||
}
|
||||
proxy.getCommandManager().register(commandName, velocityCommand);
|
||||
CommandMeta meta = proxy.getCommandManager().metaBuilder(commandName).build();
|
||||
proxy.getCommandManager().register(meta, velocityCommand);
|
||||
}
|
||||
velocityCommand.isRegistered = true;
|
||||
registeredCommands.put(commandName, velocityCommand);
|
||||
|
||||
@@ -30,8 +30,9 @@ import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
import com.velocitypowered.api.command.Command;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.command.SimpleCommand;
|
||||
|
||||
public class VelocityRootCommand implements Command, RootCommand {
|
||||
public class VelocityRootCommand implements Command, RootCommand, SimpleCommand {
|
||||
|
||||
private final VelocityCommandManager manager;
|
||||
private final String name;
|
||||
@@ -86,4 +87,9 @@ public class VelocityRootCommand implements Command, RootCommand {
|
||||
public BaseCommand getDefCommand() {
|
||||
return defCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Invocation invocation) {
|
||||
execute(invocation.source(), invocation.arguments());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user