Package net.minecraftforge.client
Class ClientCommandHandler
java.lang.Object
net.minecraftforge.client.ClientCommandHandler
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static com.mojang.brigadier.CommandDispatcher<CommandSourceStack>private static final org.apache.logging.log4j.Logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate static <S> voidcopy(com.mojang.brigadier.tree.CommandNode<S> sourceNode, com.mojang.brigadier.tree.CommandNode<S> resultNode) Creates a deep copy of the sourceNode while keeping the redirects referring to the old command treestatic com.mojang.brigadier.CommandDispatcher<CommandSourceStack>static ClientCommandSourceStackprivate static voidstatic voidinit()static com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider>mergeServerCommands(com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider> serverCommands, CommandBuildContext buildContext) static booleanrunCommand(String command) Always try to execute the cached parsing of a typed command as a clientside command.
- 
Field Details- 
LOGGERprivate static final org.apache.logging.log4j.Logger LOGGER
- 
commands
 
- 
- 
Constructor Details- 
ClientCommandHandlerpublic ClientCommandHandler()
 
- 
- 
Method Details- 
initpublic static void init()
- 
handleClientPlayerLogin
- 
mergeServerCommands@Internal public static com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider> mergeServerCommands(com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider> serverCommands, CommandBuildContext buildContext) 
- 
getDispatcher- Returns:
- The command dispatcher for client side commands
 
- 
getSource- Returns:
- A ClientCommandSourceStackfor the player in the current client
 
- 
copyprivate static <S> void copy(com.mojang.brigadier.tree.CommandNode<S> sourceNode, com.mojang.brigadier.tree.CommandNode<S> resultNode) Creates a deep copy of the sourceNode while keeping the redirects referring to the old command tree- Parameters:
- sourceNode- the original
- resultNode- the result
 
- 
runCommandAlways try to execute the cached parsing of a typed command as a clientside command. Requires that the execute field of the commands to be set to send to server so that they aren't treated as client command's that do nothing.Commands.performCommand(ParseResults, String)for reference- Parameters:
- command- the full command to execute, no preceding slash
- Returns:
- falseleaves the message to be sent to the server, while- truemeans it should be caught before LocalPlayer#sendCommand
 
 
-