screen

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangedSlots added in v1.18.1

type ChangedSlots map[int]*Slot

func (ChangedSlots) WriteTo added in v1.18.1

func (c ChangedSlots) WriteTo(w io.Writer) (n int64, err error)

type Container

type Container interface {
	// contains filtered or unexported methods
}

type Error

type Error struct {
	Err error
}

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type EventsListener

type EventsListener struct {
	Open    func(id int) error
	SetSlot func(id, index int) error
	Close   func(id int) error
}

type Inventory

type Inventory struct {
	Slots [46]Slot
}

func (*Inventory) Armor

func (inv *Inventory) Armor() []Slot

Armor returns to the armor section of the Inventory. The length is 4, which are head, chest, legs and feet.

func (*Inventory) CraftingInput

func (inv *Inventory) CraftingInput() []Slot

func (*Inventory) CraftingOutput

func (inv *Inventory) CraftingOutput() *Slot

func (*Inventory) Hotbar

func (inv *Inventory) Hotbar() []Slot

func (*Inventory) Main

func (inv *Inventory) Main() []Slot

func (*Inventory) Offhand

func (inv *Inventory) Offhand() *Slot

type Manager

type Manager struct {
	Screens   map[int]Container
	Inventory Inventory
	Cursor    Slot
	// contains filtered or unexported fields
}

func NewManager

func NewManager(c *bot.Client, e EventsListener) *Manager

func (*Manager) ContainerClick added in v1.18.1

func (m *Manager) ContainerClick(id int, slot int16, button byte, mode int32, slots ChangedSlots, carried *Slot) error

type Slot

type Slot struct {
	ID    pk.VarInt
	Count pk.Byte
	NBT   nbt.RawMessage
}

func (*Slot) ReadFrom

func (s *Slot) ReadFrom(r io.Reader) (n int64, err error)

func (*Slot) WriteTo added in v1.18.1

func (s *Slot) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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