Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blocks ¶
type Blocks struct {
// contains filtered or unexported fields
}
Blocks is a Palette that exists out of a slice of world.Block. It is a static palette in the sense that the blocks returned in the Blocks method do not change.
func NewBlocks ¶
NewBlocks creates a Blocks palette that returns the blocks passed in the Blocks method.
type DeleteCommand ¶
type DeleteCommand struct { Sub cmd.SubCommand `cmd:"delete"` // Name is the name of the palette to delete. Upon deleting, the palette will be removed from the database // it is stored in. Name paletteName `cmd:"name"` // contains filtered or unexported fields }
DeleteCommand implements the deletion of palettes previously saved using SaveCommand.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles the selection and storage of palettes during the session of a player.
func LookupHandler ¶
LookupHandler finds the Handler of a specific player.Player, assuming it is currently online.
func NewHandler ¶
NewHandler creates a Handler for the *player.Player passed.
func (*Handler) HandleBlockBreak ¶
HandleBlockBreak handles selection of a block for the palette.
func (*Handler) HandleItemUseOnBlock ¶
HandleItemUseOnBlock handles selection of a block for the palette.
func (*Handler) HandleQuit ¶
func (h *Handler) HandleQuit()
HandleQuit deletes the Handler from the handlers map.
func (*Handler) Palette ¶
Palette looks up the Palette with the name passed. If found, the Palette returned is non-nil and the bool true.
If "m" or "M" is passed as Palette, the Palette will always be non-nil. Note that this Palette might still, however, be zero. This should be checked for using len(Palette.Blocks()).
type Palette ¶
type Palette interface { // Blocks returns the list of world.Block that should be used as palette for a world edit action. Blocks can // return the same world.Block multiple times to change the occurrence of one block vs another block. Blocks() []world.Block }
Palette is a source for a selection of world.Block to be used in a world edit action.
type SaveCommand ¶
type SaveCommand struct { Sub cmd.SubCommand `cmd:"save"` // Name is the name by which the palette currently selected should be saved. The palette will be saved to a // database so that it can be reloaded when the server restarts. Name string `cmd:"name"` // contains filtered or unexported fields }
SaveCommand implements the saving of palettes to disk, so that they may be re-used.
type Selection ¶
Selection is a Palette implementation based on a selection done by a player in a world. It is directly tied to that world and cannot return the blocks without it.
func NewSelection ¶
NewSelection creates a new Selection based on the two corners and a world.
type SetCommand ¶
type SetCommand struct { Sub cmd.SubCommand `cmd:"set"` // contains filtered or unexported fields }
SetCommand implements the selection of a Selection palette in the world that a player is in. This palette may later be saved using SaveCommand.