Contents
Class AbstractAsyncCommand
java.lang.Object
com.hypixel.hytale.server.core.command.system.AbstractCommand
com.hypixel.hytale.server.core.command.system.basecommands.AbstractAsyncCommand
- Direct Known Subclasses:
AbstractAsyncPlayerCommand, AbstractAsyncWorldCommand, AbstractCommandCollection, AbstractPlayerCommand, AbstractTargetEntityCommand, AbstractTargetPlayerCommand, AbstractTargetPlayersCommand, AbstractWorldCommand, AssetsCommand.AssetLongestAssetNameCommand, AssetsDuplicatesCommand, BackupCommand, BanCommand, CancelCommand.CancelGlobalCommand, ConvertPrefabsCommand, GenerateI18nCommand, GiveArmorCommand, HelpCommand, InstanceEditCopyCommand, InstanceEditListCommand, InstanceEditLoadCommand, InstanceEditNewCommand, InstanceMigrateCommand, MacroCommandBase, StartCommand.StartGlobalCommand, UIGalleryCommand, UnbanCommand, UpdateCheckCommand, UpdateDownloadCommand, ValidateCPBCommand, WaitCommand, WhitelistAddCommand, WhitelistDisableCommand, WhitelistEnableCommand, WhitelistRemoveCommand, WhoCommand, WorldAddCommand, WorldPruneCommand, WorldSaveCommand
An abstract command class for commands that run asynchronously.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractCommand
AbstractCommand.SuggestionOverrideEntry -
Field Summary
Fields inherited from class AbstractCommand
EMPTY_STRING_ARRAY, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAsyncCommand(String description) Variant Constructor for anAbstractAsyncCommandinstance.AbstractAsyncCommand(String name, String description) Default Constructor for anAbstractAsyncCommandinstance.AbstractAsyncCommand(String name, String description, boolean requiresConfirmation) Constructor for anAbstractAsyncCommandinstance. -
Method Summary
Modifier and TypeMethodDescriptionrunAsync(CommandContext context, Runnable runnable, Executor executor) A method for simplifying the syntax of running certain async tasks.Methods inherited from class AbstractCommand
acceptCall, addAliases, addSubCommand, addUsageVariant, completeRegistration, countParents, getAliases, getDescription, getFullyQualifiedName, getName, getOptionalArgument, getOptionalArguments, getOwner, getPermission, getPermissionGroups, getPermissionGroupsRecursive, getRequiredArguments, getSubCommand, getSubCommands, getSuggestionOverrides, getUsageShort, getUsageString, getVariantByArgCount, getVariantCommands, hasBeenRegistered, hasPermission, isVariant, matches, putRecursivePermissionGroups, requireNoPermission, requirePermission, requirePermission, setAllowsExtraArguments, setOwner, withDefaultArg, withDefaultArg, withFlagArg, withListDefaultArg, withListOptionalArg, withListRequiredArg, withOptionalArg, withOptionalArg, withRequiredArg, withRequiredArg
-
Constructor Details
-
AbstractAsyncCommand
Default Constructor for anAbstractAsyncCommandinstance.- Parameters:
name- The name of the command.description- The description of the command.
-
AbstractAsyncCommand
public AbstractAsyncCommand(@Nonnull String name, @Nonnull String description, boolean requiresConfirmation) Constructor for anAbstractAsyncCommandinstance.- Parameters:
name- The name of the command.description- The description of the command.requiresConfirmation- Whether a confirmation parameter is required to execute.
-
AbstractAsyncCommand
Variant Constructor for anAbstractAsyncCommandinstance.- Parameters:
description- The description of the command.
-
-
Method Details
-
runAsync
@Nonnull public CompletableFuture<Void> runAsync(@Nonnull CommandContext context, @Nonnull Runnable runnable, @Nonnull Executor executor) A method for simplifying the syntax of running certain async tasks.- Parameters:
context- TheCommandContextpassed by the execute methodrunnable- ARunnableto be run asynchronouslyexecutor- TheExecutorto execute this task on- Returns:
- An incomplete
CompletableFuture<Void>that runs theRunnableon theExecutor
-