Test CommandManager
This commit is contained in:
@@ -46,6 +46,7 @@ import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.checkerframework.checker.lock.qual.GuardedBy;
|
||||
import org.jetbrains.annotations.VisibleForTesting;
|
||||
|
||||
public class VelocityCommandManager implements CommandManager {
|
||||
|
||||
@@ -238,9 +239,9 @@ public class VelocityCommandManager implements CommandManager {
|
||||
return dispatcher.getRoot().getChild(alias.toLowerCase(Locale.ENGLISH)) != null;
|
||||
}
|
||||
|
||||
public CommandDispatcher<CommandSource> getDispatcher() {
|
||||
// TODO Can we remove this? This is only used by tests, and constitutes unsafe publication.
|
||||
return dispatcher;
|
||||
@VisibleForTesting // this constitutes unsafe publication
|
||||
RootCommandNode<CommandSource> getRoot() {
|
||||
return dispatcher.getRoot();
|
||||
}
|
||||
|
||||
public CommandGraphInjector<CommandSource> getInjector() {
|
||||
|
Reference in New Issue
Block a user