Class NeoForgeClientCommandManager<C>

java.lang.Object
org.incendo.cloud.CommandManager<C>
org.incendo.cloud.neoforge.NeoForgeCommandManager<C>
org.incendo.cloud.neoforge.NeoForgeClientCommandManager<C>
Type Parameters:
C - the command sender type
All Implemented Interfaces:
BrigadierManagerHolder<C, net.minecraft.commands.CommandSourceStack>, CommandBuilderSource<C>, SenderMapperHolder<net.minecraft.commands.CommandSourceStack, C>, Stateful<RegistrationState>

public final class NeoForgeClientCommandManager<C> extends NeoForgeCommandManager<C>
A command manager for registering client-side commands.

All commands should be registered within mod initializers. Any registrations occurring after the first call to RegisterClientCommandsEvent will be considered unsafe, and will only be permitted when the unsafe registration manager option is enabled.

  • Constructor Details

    • NeoForgeClientCommandManager

      public NeoForgeClientCommandManager(ExecutionCoordinator<C> executionCoordinator, SenderMapper<net.minecraft.commands.CommandSourceStack, C> senderMapper)
      Create a new command manager instance.
      Parameters:
      executionCoordinator - Execution coordinator instance.
      senderMapper - Mapper between Minecraft's CommandSourceStack and the command sender type C.
  • Method Details

    • createNative

      public static NeoForgeClientCommandManager<net.minecraft.commands.CommandSourceStack> createNative(ExecutionCoordinator<net.minecraft.commands.CommandSourceStack> executionCoordinator)
      Create a command manager using native source types.
      Parameters:
      executionCoordinator - Execution coordinator instance.
      Returns:
      a new command manager
      See Also:
    • hasPermission

      public boolean hasPermission(@NonNull C sender, @NonNull String permission)
      Check if a sender has a certain permission.

      The implementation for client commands always returns true.

      Specified by:
      hasPermission in class CommandManager<C>
      Parameters:
      sender - Command sender
      permission - Permission node
      Returns:
      whether the sender has the specified permission