CommandNodeHelper
com.jsmacrosce.jsmacros.client.api.helper.CommandNodeHelper
Holds server- and client-side command nodes returned by unregistration for re-registration.
Either node may be null when that dispatcher had no matching command.
js
const manager = Chat.getCommandManager();
// take a command out, which gives back the node it was built from
const node = manager.unregisterCommand("hello");
if (node !== null) {
// Either dispatcher may have had no matching command.
if (node.getRaw() !== null) {
Chat.log("was a server command");
}
if (node.fabric !== null) {
Chat.log("was also a client side command");
}
// put it straight back
manager.reRegisterCommand(node);
}Constructors
new CommandNodeHelper
new CommandNodeHelper(CommandNode<?> base)#Wraps a server-side command node without a client-side node.
Parameters:
base: the server-side node, ornull
new CommandNodeHelper(CommandNode<?> base, CommandNode<?> fabric)#Wraps the server- and client-side command nodes; either may be
null.Parameters:
base: the node taken out of the server's command dispatcher, ornullfabric: the node taken out of the client-side command dispatcher, ornull
Fields
fabric
The node removed from the client-side command dispatcher, or
null if none was removed.