Documentation
¶
Index ¶
- Variables
- type Armour
- func (a *Armour) Boots() item.Stack
- func (a *Armour) Chestplate() item.Stack
- func (a *Armour) Clear() []item.Stack
- func (a *Armour) Close() error
- func (a *Armour) Damage(dmg float64, f DamageFunc)
- func (a *Armour) DamageReduction(dmg float64, src world.DamageSource) float64
- func (a *Armour) Handle(h Handler)
- func (a *Armour) Helmet() item.Stack
- func (a *Armour) HighestEnchantmentLevel(t item.EnchantmentType) int
- func (a *Armour) Inventory() *Inventory
- func (a *Armour) Items() []item.Stack
- func (a *Armour) KnockBackResistance() float64
- func (a *Armour) Leggings() item.Stack
- func (a *Armour) Set(helmet, chestplate, leggings, boots item.Stack)
- func (a *Armour) SetBoots(boots item.Stack)
- func (a *Armour) SetChestplate(chestplate item.Stack)
- func (a *Armour) SetHelmet(helmet item.Stack)
- func (a *Armour) SetLeggings(leggings item.Stack)
- func (a *Armour) Slots() []item.Stack
- func (a *Armour) String() string
- func (a *Armour) ThornsDamage(f DamageFunc) float64
- type Context
- type DamageFunc
- type Handler
- type Holder
- type Inventory
- func (inv *Inventory) AddItem(it item.Stack) (n int, err error)
- func (inv *Inventory) Clear() []item.Stack
- func (inv *Inventory) Clone(f SlotFunc) *Inventory
- func (inv *Inventory) Close() error
- func (inv *Inventory) ContainsItem(it item.Stack) bool
- func (inv *Inventory) ContainsItemFunc(n int, comparable func(stack item.Stack) bool) bool
- func (inv *Inventory) Empty() bool
- func (inv *Inventory) First(item item.Stack) (int, bool)
- func (inv *Inventory) FirstEmpty() (int, bool)
- func (inv *Inventory) FirstFunc(comparable func(stack item.Stack) bool) (int, bool)
- func (inv *Inventory) Handle(h Handler)
- func (inv *Inventory) Handler() Handler
- func (inv *Inventory) Item(slot int) (item.Stack, error)
- func (inv *Inventory) Items() []item.Stack
- func (inv *Inventory) Merge(inv2 *Inventory, f func(int, item.Stack, item.Stack)) *Inventory
- func (inv *Inventory) RemoveItem(it item.Stack) error
- func (inv *Inventory) RemoveItemFunc(n int, comparable func(stack item.Stack) bool) error
- func (inv *Inventory) SetItem(slot int, item item.Stack) error
- func (inv *Inventory) Size() int
- func (inv *Inventory) SlotFunc(f SlotFunc)
- func (inv *Inventory) SlotValidatorFunc(f SlotValidatorFunc)
- func (inv *Inventory) Slots() []item.Stack
- func (inv *Inventory) String() string
- func (inv *Inventory) Swap(slotA, slotB int) error
- type NopHandler
- type SlotFunc
- type SlotValidatorFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSlotOutOfRange = errors.New("slot is out of range: must be in range 0 <= slot < inventory.Size()")
Functions ¶
This section is empty.
Types ¶
type Armour ¶
type Armour struct {
// contains filtered or unexported fields
}
func (*Armour) Chestplate ¶
func (*Armour) Damage ¶
func (a *Armour) Damage(dmg float64, f DamageFunc)
func (*Armour) DamageReduction ¶
func (a *Armour) DamageReduction(dmg float64, src world.DamageSource) float64
func (*Armour) HighestEnchantmentLevel ¶
func (a *Armour) HighestEnchantmentLevel(t item.EnchantmentType) int
func (*Armour) KnockBackResistance ¶
func (*Armour) SetChestplate ¶
func (*Armour) SetLeggings ¶
func (*Armour) ThornsDamage ¶
func (a *Armour) ThornsDamage(f DamageFunc) float64
type Inventory ¶
type Inventory struct {
// contains filtered or unexported fields
}
func (*Inventory) ContainsItemFunc ¶
func (*Inventory) FirstEmpty ¶
func (*Inventory) RemoveItemFunc ¶
func (*Inventory) SlotValidatorFunc ¶
func (inv *Inventory) SlotValidatorFunc(f SlotValidatorFunc)
type NopHandler ¶
type NopHandler struct{}
func (NopHandler) HandleDrop ¶
func (NopHandler) HandleDrop(*Context, int, item.Stack)
func (NopHandler) HandlePlace ¶
func (NopHandler) HandlePlace(*Context, int, item.Stack)
func (NopHandler) HandleTake ¶
func (NopHandler) HandleTake(*Context, int, item.Stack)
Click to show internal directories.
Click to hide internal directories.