item

package
v0.0.0-...-2a33acd Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearItems

func ClearItems()

func GetItemID

func GetItemID(item Item) uint16

func RegisterItem

func RegisterItem(item Item)

func ValidItem

func ValidItem(name string) bool

Types

type Basic

type Basic struct {
	// contains filtered or unexported fields
}

func NewBasic

func NewBasic(name string) *Basic

func (*Basic) Name

func (b *Basic) Name() string

func (*Basic) OnClick

func (b *Basic) OnClick(w block.World, p Player, pos block.Pos, face block.Face)

type BlockItem

type BlockItem struct {
	*Basic
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(name string) *BlockItem

func (*BlockItem) Block

func (b *BlockItem) Block() *block.Kind

func (*BlockItem) OnClick

func (b *BlockItem) OnClick(w block.World, p Player, pos block.Pos, face block.Face)

type InventoryWindow

type InventoryWindow interface {
	SetItem(index uint16, stack *Stack) error
}

type Item

type Item interface {
	Name() string
	OnClick(w block.World, p Player, pos block.Pos, face block.Face)
}

func GetItem

func GetItem(name string) Item

func GetItemFromID

func GetItemFromID(id uint16) Item

type Player

type Player interface {
	Name() string
	Inventory() PlayerInventory
	SendChat(msg *util.Chat)

	AxisFacing() block.Face
}

type PlayerInventory

type PlayerInventory interface {
	HeldItem() *Stack
	SetHeldItem(stack *Stack)
	SetHeldItemSlot(slot uint16)
	SetItem(index uint16, item *Stack)
	SetHotbarItem(index uint16, item *Stack)

	Equipment() map[int]*Stack
	NeedsEquipmentChange() bool
	ClearEquipmentChange()
	OpenWindow(id byte, title *util.Chat) InventoryWindow
}

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewItemFromProto

func NewItemFromProto(proto *pb.Item) *Stack

func NewItemStack

func NewItemStack(item Item, count byte, nbt *nbt.Tag) *Stack

func NewItemStackID

func NewItemStackID(id uint16, count byte, nbt *nbt.Tag) *Stack

func (*Stack) AttackDamage

func (i *Stack) AttackDamage() float64

func (*Stack) AttackSpeed

func (i *Stack) AttackSpeed() float64

func (*Stack) Count

func (i *Stack) Count() byte

func (*Stack) ID

func (i *Stack) ID() uint16

func (*Stack) Item

func (i *Stack) Item() Item

func (*Stack) NBT

func (i *Stack) NBT() *nbt.Tag

func (*Stack) String

func (i *Stack) String() string

func (*Stack) ToProto

func (i *Stack) ToProto() *pb.Item

Jump to

Keyboard shortcuts

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