Class SimpleCommand

java.lang.Object
com.hypixel.hytale.server.core.command.system.AbstractCommand
fr.hytale.loader.command.SimpleCommand

public class SimpleCommand extends com.hypixel.hytale.server.core.command.system.AbstractCommand
Internal command wrapper for HytaleLoader.

This class wraps methods annotated with Command and integrates them with Hytale's native command system. It uses reflection to invoke the command methods when executed.

Since:
1.0.0
Version:
1.0.4
Author:
HytaleLoader
  • Field Summary

    Fields inherited from class com.hypixel.hytale.server.core.command.system.AbstractCommand

    EMPTY_STRING_ARRAY, LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleCommand(String name, String description, boolean requiresConfirmation, Method method, Object instance)
    Constructs a new SimpleCommand.
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(com.hypixel.hytale.server.core.command.system.CommandContext context)
    Executes the command by invoking the wrapped method.

    Methods inherited from class com.hypixel.hytale.server.core.command.system.AbstractCommand

    acceptCall, addAliases, addSubCommand, addUsageVariant, canGeneratePermission, completeRegistration, countParents, generatePermissionNode, getAliases, getDescription, getFullyQualifiedName, getName, getOwner, getPermission, getPermissionGroups, getPermissionGroupsRecursive, getRequiredArguments, getSubCommands, getUsageShort, getUsageString, hasBeenRegistered, hasPermission, isVariant, matches, putRecursivePermissionGroups, requirePermission, setAllowsExtraArguments, setOwner, setPermissionGroup, setPermissionGroups, setUnavailableInSingleplayer, withDefaultArg, withDefaultArg, withFlagArg, withListDefaultArg, withListOptionalArg, withListRequiredArg, withOptionalArg, withOptionalArg, withRequiredArg, withRequiredArg

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleCommand

      public SimpleCommand(String name, String description, boolean requiresConfirmation, Method method, Object instance)
      Constructs a new SimpleCommand.
      Parameters:
      name - the command name
      description - the command description
      requiresConfirmation - whether the command requires confirmation
      method - the method to invoke when the command is executed
      instance - the object instance containing the method
  • Method Details

    • execute

      public CompletableFuture<Void> execute(com.hypixel.hytale.server.core.command.system.CommandContext context)
      Executes the command by invoking the wrapped method.
      Specified by:
      execute in class com.hypixel.hytale.server.core.command.system.AbstractCommand
      Parameters:
      context - the command execution context
      Returns:
      a completed future