mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Merge branch 'refs/heads/dev' into preview
This commit is contained in:
commit
aa312f7332
@ -34,6 +34,13 @@ public interface ViaVersionCommand {
|
||||
*/
|
||||
void registerSubCommand(ViaSubCommand command);
|
||||
|
||||
/**
|
||||
* Removes a subcommand by name, can be used to unload default subcommands which are not supported
|
||||
* on the platform.
|
||||
* @param name Subcommand name
|
||||
*/
|
||||
void removeSubCommand(String name);
|
||||
|
||||
/**
|
||||
* Check if a subcommand is registered.
|
||||
*
|
||||
|
@ -57,6 +57,11 @@ public abstract class ViaCommandHandler implements ViaVersionCommand {
|
||||
commandMap.put(command.name().toLowerCase(Locale.ROOT), command);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSubCommand(final String name) {
|
||||
commandMap.remove(name.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSubCommand(String name) {
|
||||
return commandMap.containsKey(name.toLowerCase(Locale.ROOT));
|
||||
|
Loading…
Reference in New Issue
Block a user