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
ConstructorsConstructorDescriptionSimpleCommand(String name, String description, boolean requiresConfirmation, Method method, Object instance) Constructs a new SimpleCommand. -
Method Summary
Modifier and TypeMethodDescriptionexecute(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
-
Constructor Details
-
SimpleCommand
public SimpleCommand(String name, String description, boolean requiresConfirmation, Method method, Object instance) Constructs a new SimpleCommand.- Parameters:
name- the command namedescription- the command descriptionrequiresConfirmation- whether the command requires confirmationmethod- the method to invoke when the command is executedinstance- 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:
executein classcom.hypixel.hytale.server.core.command.system.AbstractCommand- Parameters:
context- the command execution context- Returns:
- a completed future
-