slots

package
v0.0.0-...-18e7427 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangedSlots

type ChangedSlots map[int]*Slot

func (ChangedSlots) WriteTo

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

type Container

type Container interface {
	GetInventorySlots() []Slot
	GetHotbarSlots() []Slot
	OnSetSlot(i int, s Slot) error
	OnClose() error
}

type Slot

type Slot struct {
	Index int // The index is relative to the position in the current container, this field should not be used
	ID    item.ID
	Count int8
	NBT   SlotTags
}

func (*Slot) GetIndex

func (s *Slot) GetIndex() int

func (*Slot) Item

func (s *Slot) Item() item.Item

func (*Slot) ReadFrom

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

func (*Slot) WriteTo

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

type SlotTags

type SlotTags struct {
	Damage      int32     `nbt:"Damage"`
	Unbreakable bool      `nbt:"Unbreakable"`
	CanDestroy  []item.ID `nbt:"CanDestroy"`
}

func (*SlotTags) ReadFrom

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

func (*SlotTags) WriteTo

func (s *SlotTags) 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