Class NeoForgeServerCommandManager<C>

java.lang.Object
org.incendo.cloud.CommandManager<C>
org.incendo.cloud.neoforge.NeoForgeCommandManager<C>
org.incendo.cloud.neoforge.NeoForgeServerCommandManager<C>
All Implemented Interfaces:
BrigadierManagerHolder<C, net.minecraft.commands.CommandSourceStack>, CommandBuilderSource<C>, SenderMapperHolder<net.minecraft.commands.CommandSourceStack, C>, Stateful<RegistrationState>

public final class NeoForgeServerCommandManager<C> extends NeoForgeCommandManager<C>
  • Constructor Details

    • NeoForgeServerCommandManager

      public NeoForgeServerCommandManager(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 NeoForgeServerCommandManager<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 the command sender has the required permission. If the permission node is empty, this should return true
      Specified by:
      hasPermission in class CommandManager<C>
      Parameters:
      sender - Command sender
      permission - Permission node
      Returns:
      true if the sender has the permission, else false
      Throws:
      PermissionNotRegisteredException - if the permission is not registered to NeoForge