If a command is defined on the proxy, don't include suggestions from the backend too

This commit is contained in:
Andrew Steinborn
2020-08-24 14:53:01 -04:00
parent 10a14af2ea
commit ba7cdac812

View File

@@ -175,6 +175,10 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
filterNode(server.getCommandManager().getDispatcher().getRoot()); filterNode(server.getCommandManager().getDispatcher().getRoot());
Collection<CommandNode<CommandSource>> proxyNodes = dispatcherRootNode.getChildren(); Collection<CommandNode<CommandSource>> proxyNodes = dispatcherRootNode.getChildren();
for (CommandNode<CommandSource> node : proxyNodes) { for (CommandNode<CommandSource> node : proxyNodes) {
CommandNode<CommandSource> existingServerChild = rootNode.getChild(node.getName());
if (existingServerChild != null) {
rootNode.getChildren().remove(existingServerChild);
}
rootNode.addChild(node); rootNode.addChild(node);
} }
} }
@@ -203,7 +207,7 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
return null; return null;
} }
} catch (Throwable e) { } catch (Throwable e) {
// swallow everything cuz plugins being plugins // swallow everything because plugins
logger.error( logger.error(
"Requirement test for command node " + source + " encountered an exception", e); "Requirement test for command node " + source + " encountered an exception", e);
} }