Package dev.kotx.flylib.command

Types

Argument
Link copied to clipboard
interface Argument<T, C>

Command arguments. It can be used as a child element of Usage. There is a type in the argument, type analysis is automatically performed when the client inputs, and if it cannot be parsed, the command execution is refused.

Command
Link copied to clipboard
abstract class Command<T>(name: String)

An Command used for FlyLib

CommandContext
Link copied to clipboard
class CommandContext<T>(flyLib: FlyLib<T>, config: T?, command: Command<T>, sender: CommandSender, world: World?, server: Server, message: String, depth: Int, typedArgs: List<Any?>)

The context when the command is executed. It is passed as an argument or receiver when executing a command or completing a tab. This class holds information when executing a command or completing a tab, which can be retrieved by the plug-in that registered the command, the command itself, the sender of the command, etc. It can also send a message to the executor of the command, display usage instructions, etc.

CommandHandler
Link copied to clipboard
interface CommandHandler<T>

An interface for CommandHandlerImpl to hiding inner method

Config
Link copied to clipboard
class Config(elements: List<ConfigElement<*>>)
ConfigBuilder
Link copied to clipboard
class ConfigBuilder
ConfigElement
Link copied to clipboard
interface ConfigElement<T>
ContextAction
Link copied to clipboard
fun interface ContextAction<T>

A wrapper for a function that is called when Usage is executed You can use SAM conversation in Java

Max
Link copied to clipboard
annotation class Max(max: Long)
Min
Link copied to clipboard
annotation class Min(min: Long)
Permission
Link copied to clipboard
class Permission(name: String?, defaultPermission: PermissionDefault)

Command permissions.

Serialize
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class Serialize
Suggestion
Link copied to clipboard
class Suggestion(content: String, tooltip: String?)

Command suggestions. You can also set a tooltip (text displayed when hovering the mouse).

SuggestionAction
Link copied to clipboard
fun interface SuggestionAction<T>

Builder Action to add a suggestion

SuggestionBuilder
Link copied to clipboard
class SuggestionBuilder<T>(plugin: JavaPlugin, command: Command<T>, sender: CommandSender, world: World?, server: Server, message: String, depth: Int, typedArgs: List<Any?>)

A builder that creates a list of suggestions.

Usage
Link copied to clipboard
class Usage<T>(arguments: List<Argument<*, T>>, description: String?, permission: Permission?, action: ContextAction<T>?)

Command usage and definition

UsageAction
Link copied to clipboard
fun interface UsageAction<T>

Usage Builder actions

UsageBuilder
Link copied to clipboard
class UsageBuilder<T>

Builder for creating arguments and definitions.