Documentation ¶
Index ¶
- Constants
- func RegisterCommands(commands ...*Command) *pk.DeclareCommands
- type Argument
- func NewBoolArg(name string) Argument
- func NewChatComponentArg(name string) Argument
- func NewDimensionArg(name string) Argument
- func NewEntityArg(name string, properties byte) Argument
- func NewFloatArg(name string) Argument
- func NewGamemodeArg(name string) Argument
- func NewIntArg(name string) Argument
- func NewResourceKeyArg(name string, registry string) Argument
- func NewStrArg(name string, properties stringArgType) Argument
- func NewVector2Arg(name string) Argument
- func NewVector3Arg(name string) Argument
- type Command
- type CommandContext
- func (ctx *CommandContext) Error(msg string)
- func (ctx *CommandContext) ErrorHere(msg string)
- func (ctx CommandContext) GetBool(name string) (value bool, ok bool)
- func (ctx CommandContext) GetFloat32(name string) (value float32, ok bool)
- func (ctx CommandContext) GetFloat64(name string) (value float64, ok bool)
- func (ctx CommandContext) GetInt32(name string) (value int32, ok bool)
- func (ctx CommandContext) GetInt64(name string) (value int64, ok bool)
- func (ctx CommandContext) GetString(name string) (value string, ok bool)
- func (ctx CommandContext) GetVector2(name string) (x, y float64, ok bool)
- func (ctx CommandContext) GetVector3(name string) (x, y, z float64, ok bool)
- func (ctx *CommandContext) Incomplete()
- func (ctx *CommandContext) Reply(message chat.Message)
- type Graph
- type Parser
- type SuggestionsContext
Constants ¶
View Source
const ( SingleWord stringArgType = iota QuotablePhrase GreedyPhrase )
View Source
const ( EntitySingle = iota + 1 EntityPlayerOnly )
View Source
const ( ChatModeEnabled = iota ChatModeCommandsOnly ChatModeHidden )
Variables ¶
This section is empty.
Functions ¶
func RegisterCommands ¶
func RegisterCommands(commands ...*Command) *pk.DeclareCommands
Types ¶
type Argument ¶
type Argument struct { Name string Suggest func(ctx SuggestionsContext) Parser Parser Alternative *Argument }
func NewBoolArg ¶
func NewChatComponentArg ¶
func NewDimensionArg ¶
func NewEntityArg ¶
func NewFloatArg ¶
func NewGamemodeArg ¶
func NewResourceKeyArg ¶
func NewVector2Arg ¶
func NewVector3Arg ¶
func (Argument) SetAlternative ¶
func (Argument) SetSuggest ¶
func (a Argument) SetSuggest(s func(ctx SuggestionsContext)) Argument
type Command ¶
type Command struct { Name string Arguments []Argument Aliases []string Execute func(ctx CommandContext) RequiredPermissions []string }
func (*Command) AddArguments ¶
type CommandContext ¶
type CommandContext struct { Command *Command Executor interface{} Arguments []string Salt, Timestamp int64 ArgumentSignatures []pk.Argument FullCommand string }
func (*CommandContext) Error ¶
func (ctx *CommandContext) Error(msg string)
func (*CommandContext) ErrorHere ¶
func (ctx *CommandContext) ErrorHere(msg string)
func (CommandContext) GetBool ¶
func (ctx CommandContext) GetBool(name string) (value bool, ok bool)
func (CommandContext) GetFloat32 ¶
func (ctx CommandContext) GetFloat32(name string) (value float32, ok bool)
func (CommandContext) GetFloat64 ¶
func (ctx CommandContext) GetFloat64(name string) (value float64, ok bool)
func (CommandContext) GetInt32 ¶
func (ctx CommandContext) GetInt32(name string) (value int32, ok bool)
func (CommandContext) GetInt64 ¶
func (ctx CommandContext) GetInt64(name string) (value int64, ok bool)
func (CommandContext) GetString ¶
func (ctx CommandContext) GetString(name string) (value string, ok bool)
func (CommandContext) GetVector2 ¶
func (ctx CommandContext) GetVector2(name string) (x, y float64, ok bool)
func (CommandContext) GetVector3 ¶
func (ctx CommandContext) GetVector3(name string) (x, y, z float64, ok bool)
func (*CommandContext) Incomplete ¶
func (ctx *CommandContext) Incomplete()
func (*CommandContext) Reply ¶
func (ctx *CommandContext) Reply(message chat.Message)
type Graph ¶
type Graph struct {
Commands []*Command
}
func (*Graph) AddCommands ¶
func (Graph) Data ¶
func (graph Graph) Data() *pk.DeclareCommands
func (*Graph) DeleteCommand ¶
func (*Graph) FindCommand ¶
type Parser ¶
type Parser struct { ID int32 Properties types.CommandProperties }
type SuggestionsContext ¶
type SuggestionsContext struct { Executor interface{} TransactionId int32 Arguments []string FullCommand string }
func (*SuggestionsContext) Return ¶
func (c *SuggestionsContext) Return(suggestions []pk.SuggestionMatch)
Click to show internal directories.
Click to hide internal directories.