plugin_structs

package
v0.0.0-...-d1826b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2022 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DelayModeContinuous = 0
	DelayModeDiscrete   = 1
	DelayModeNone       = 2
	DelayModeInvalid    = 100
)
View Source
const (
	TaskTypeSync    = 0
	TaskTypeAsync   = 1
	TaskTypeInvalid = 100
)
View Source
const (
	TaskDisplayYes     = 1
	TaskDisplayNo      = 0
	TaskDisplayInvalid = 30
)
View Source
const (
	FunctionTypeSimple   = 0 // End of simple chain
	FunctionTypeContinue = 1 // Simple chain
	FunctionTypeRegular  = 2
)
View Source
const (
	SimpleFunctionArgumentString  = 0
	SimpleFunctionArgumentDecider = 1
	SimpleFunctionArgumentInt     = 2
)

Variables

This section is empty.

Functions

func MakeTaskDisplayMode

func MakeTaskDisplayMode(mode byte) string

func MakeTaskType

func MakeTaskType(mode byte) string

func ParseDelayMode

func ParseDelayMode(mode string) byte

func ParseTaskDisplayMode

func ParseTaskDisplayMode(mode string) byte

func ParseTaskType

func ParseTaskType(mode string) byte

func StrDelayMode

func StrDelayMode(mode byte) string

Types

type Block

type Block struct {
	Name *string
	Data uint16
}

func CreateBlock

func CreateBlock(name string, data uint16) *Block

type ChestData

type ChestData []ChestSlot

type ChestSlot

type ChestSlot struct {
	Name   string
	Count  uint8
	Damage uint16
	Slot   uint8
}

type CommandBlockData

type CommandBlockData struct {
	Mode               uint32
	Command            string
	CustomName         string
	LastOutput         string
	TickDelay          int32
	ExecuteOnFirstTick bool //byte
	TrackOutput        bool //byte
	Conditional        bool
	NeedRedstone       bool
}

type CommandOutputMessage

type CommandOutputMessage struct {
	Success    bool
	Message    string
	Parameters []string
}

type ConstBlock

type ConstBlock struct {
	Name string
	Data uint16
}

func (*ConstBlock) Take

func (req *ConstBlock) Take() *Block

type DelayConfig

type DelayConfig struct {
	Delay          int64
	DelayMode      byte
	DelayThreshold int
}

type DoubleModule

type DoubleModule struct {
	Begin           Position
	End             Position
	Block, OldBlock *Block
	Entity          *Entity
}

type Entity

type Entity string

type FloatPosition

type FloatPosition struct {
	X, Y, Z float64
}

func (*FloatPosition) TransferInt

func (p *FloatPosition) TransferInt() Position

type Function

type Function struct {
	Name          string
	OwnedKeywords []string

	FunctionType    byte
	SFMinSliceLen   uint16
	SFArgumentTypes []byte
	FunctionContent interface{} // Regular/Simple: func(interface{}(~~*minecraft.Conn~~),interface{})

}

type FunctionChainItem

type FunctionChainItem struct {
	FunctionType  byte
	ArgumentTypes []byte
	Content       interface{}
}

type GlobalConfig

type GlobalConfig struct {
	TaskCreationType byte
	TaskDisplayMode  byte
}

type MainConfig

type MainConfig struct {
	Execute               string
	Block, OldBlock       *ConstBlock
	End, Position         Position //Position=Begin
	Radius                int
	Length, Width, Height int
	Method, OldMethod     string
	Facing, Path, Shape   string
	ExcludeCommands       bool
	InvalidateCommands    bool
	Strict                bool
}

type Module

type Module struct {
	Block            *Block
	CommandBlockData *CommandBlockData
	ChestData        *ChestData
	//Entity *Entity
	Point Position
}

type PluginBridge

type PluginBridge interface {
	ConvertFunctionChainItemList(list map[string]FunctionChainItem) interface{}
	RegisterBuilder(name string, function func(config MainConfig, blc chan *Module) error) bool
	// --> function.RegisterFunction
	RegisterFunction(function Function)
	// --> function.RegisterEnum
	RegisterEnum(desc string, parser func(string) byte, inv byte) int
	// --> command.Tellraw -> command.SendChat
	Tellraw(message string) error
	// --> command.SendChat
	SendChat(content string) error
	// --> command.SendSizukanaCommand
	SendCommand(command string) error
	// "CB" stands for callback.
	SendCommandCB(command string, cb func([]CommandOutputMessage, string))
	SendWSCommandCB(command string, cb func([]CommandOutputMessage, string))
	// 1st arg: username, 2nd arg: content
	SubscribeChat(cb func(string, string))
}

type Position

type Position struct {
	X, Y, Z int
}

func (Position) FromInt

func (p Position) FromInt(arr []int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL