inventory

package
v0.0.0-...-54241fc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSlotToNetworkSlot

func DataSlotToNetworkSlot(index int8) int16

func NetworkSlotToDataSlot

func NetworkSlotToDataSlot(index int16) int8

Types

type Inventory

type Inventory struct {
	SelectedSlot atomic.Value[int32]
	// contains filtered or unexported fields
}

func Import

func Import(inv []item.Item, selectedSlot int32) *Inventory

func (*Inventory) Clear

func (inv *Inventory) Clear()

func (*Inventory) Collect

func (inv *Inventory) Collect(slot int8)

func (*Inventory) Data

func (inv *Inventory) Data() (i []packet.Slot)

Data returns the inventory slots for the set container content packet

func (*Inventory) DeleteSlot

func (inv *Inventory) DeleteSlot(i int8)

func (*Inventory) Export

func (inv *Inventory) Export() []item.Item

Export returns the inventory slots for the player NBT data

func (*Inventory) HeldItem

func (inv *Inventory) HeldItem() (item.Item, bool)

func (*Inventory) Merge

func (inv *Inventory) Merge(slot int8)

func (*Inventory) SetCarriedItem

func (inv *Inventory) SetCarriedItem(slot int8)

func (*Inventory) SetCount

func (inv *Inventory) SetCount(s int8, count int8)

func (*Inventory) SetSlot

func (inv *Inventory) SetSlot(s int8, i item.Item)

func (*Inventory) Slot

func (inv *Inventory) Slot(i int8) (item.Item, bool)

func (*Inventory) Split

func (inv *Inventory) Split(slot int8)

func (*Inventory) Swap

func (inv *Inventory) Swap(slot int8, slot1 int8)

func (*Inventory) UncarryItem

func (inv *Inventory) UncarryItem(slot int8)

Jump to

Keyboard shortcuts

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