grids

package
v0.0.0-...-bbed0de Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Anvil

type Anvil struct {
	*Generic
}

func NewAnvil

func NewAnvil() *Anvil

func (*Anvil) GetOutputItem

func (a *Anvil) GetOutputItem() *slots.Slot

func (*Anvil) SetFirstItem

func (a *Anvil) SetFirstItem(slot *slots.Slot) error

func (*Anvil) SetOutputName

func (a *Anvil) SetOutputName(conn *net.Conn, name string) error

func (*Anvil) SetSecondItem

func (a *Anvil) SetSecondItem(slot *slots.Slot) error

type Beacon

type Beacon struct {
	*Generic
}

func NewBeacon

func NewBeacon() *Beacon

type BlastFurnace

type BlastFurnace struct {
	*Generic
}

func NewBlastFurnace

func NewBlastFurnace() *BlastFurnace

type BrewingStand

type BrewingStand struct {
	*Generic
}

func NewBrewingStand

func NewBrewingStand() *BrewingStand

type CartographyTable

type CartographyTable struct {
	*Generic
}

func NewCartographyTable

func NewCartographyTable() *CartographyTable

type Container

type Container interface {
	GetSlot(int) *slots.Slot
	SetSlot(int, *slots.Slot) error
	OnClose() error
	GetType() int
	GetSize() int
}

type CraftingTable

type CraftingTable struct {
	*Generic
}

func NewCraftingTable

func NewCraftingTable() *CraftingTable

type EnchantmentTable

type EnchantmentTable struct {
	*Generic
}

func NewEnchantmentTable

func NewEnchantmentTable() *EnchantmentTable

type Furnace

type Furnace struct {
	*Generic
}

func NewFurnace

func NewFurnace() *Furnace

type Generic

type Generic struct {
	Name string // Name of the grid.
	Type int    // Type is the int corresponding to the window type.
	Size int
	Data []*slots.Slot
}

A Generic is a grid that can be used for any type of window. Generic is different from GenericInventory When you open a chest, the chest is a Generic, but the Generic has access to the player inventory, and places the items in the slots, either in the chest or in the player inventory. If index >= size, then the slot is in the player inventory. If index < size, then the slot is in the chest.

func InitGenericContainer

func InitGenericContainer(name string, id, size int) *Generic

func (*Generic) GetSize

func (g *Generic) GetSize() int

func (*Generic) GetSlot

func (g *Generic) GetSlot(i int) *slots.Slot

func (*Generic) GetType

func (g *Generic) GetType() int

func (*Generic) OnClose

func (g *Generic) OnClose() error

func (*Generic) SetSlot

func (g *Generic) SetSlot(i int, s *slots.Slot) error

type Generic3x3

type Generic3x3 struct {
	*Generic
}

func NewGeneric3x3

func NewGeneric3x3() *Generic3x3

type Generic9x1

type Generic9x1 struct {
	*Generic
}

func NewGeneric9x1

func NewGeneric9x1() *Generic9x1

type Generic9x2

type Generic9x2 struct {
	*Generic
}

func NewGeneric9x2

func NewGeneric9x2() *Generic9x2

type Generic9x3

type Generic9x3 struct {
	*Generic
}

func NewGeneric9x3

func NewGeneric9x3() *Generic9x3

type Generic9x4

type Generic9x4 struct {
	*Generic
}

func NewGeneric9x4

func NewGeneric9x4() *Generic9x4

func NewGeneric9x5

func NewGeneric9x5() *Generic9x4

type Generic9x5

type Generic9x5 struct {
	*Generic
}

type Generic9x6

type Generic9x6 struct {
	*Generic
}

func NewGeneric9x6

func NewGeneric9x6() *Generic9x6

type GenericInventory

type GenericInventory struct {
	Slots [46]*slots.Slot
}

func (*GenericInventory) FindItem

func (g *GenericInventory) FindItem(predicate func(item.Item) bool) item.Item

func (*GenericInventory) FindItemNth

func (g *GenericInventory) FindItemNth(nth int, predicate func(item.Item) bool) item.Item

func (*GenericInventory) FindItemNthPoint

func (g *GenericInventory) FindItemNthPoint(nth int, predicate func(item.Item) bool, start, end int) item.Item

func (*GenericInventory) GetArmor

func (g *GenericInventory) GetArmor() []item.Item

func (*GenericInventory) GetCraftingInput

func (g *GenericInventory) GetCraftingInput() []item.Item

func (*GenericInventory) GetCraftingOutput

func (g *GenericInventory) GetCraftingOutput() item.Item

func (*GenericInventory) GetHotbar

func (g *GenericInventory) GetHotbar() []item.Item

func (*GenericInventory) GetInventory

func (g *GenericInventory) GetInventory() []item.Item

func (*GenericInventory) GetItem

func (g *GenericInventory) GetItem(i int) item.Item

func (*GenericInventory) GetOffhand

func (g *GenericInventory) GetOffhand() item.Item

func (*GenericInventory) GetSize

func (g *GenericInventory) GetSize() int

func (*GenericInventory) GetSlot

func (g *GenericInventory) GetSlot(i int) *slots.Slot

func (*GenericInventory) GetType

func (g *GenericInventory) GetType() int

func (*GenericInventory) OnClose

func (g *GenericInventory) OnClose() error

func (*GenericInventory) SetSlot

func (g *GenericInventory) SetSlot(i int, s *slots.Slot) error

type Grindstone

type Grindstone struct {
	*Generic
}

func NewGrindstone

func NewGrindstone() *Grindstone

type Hopper

type Hopper struct {
	*Generic
}

func NewHopper

func NewHopper() *Hopper

type Loom

type Loom struct {
	*Generic
}

func NewLoom

func NewLoom() *Loom

type Merchant

type Merchant struct {
	*Generic
}

func NewMerchant

func NewMerchant() *Merchant

type ShulkerBox

type ShulkerBox struct {
	*Generic
}

func NewShulkerBox

func NewShulkerBox() *ShulkerBox

type SmithingTable

type SmithingTable struct {
	*Generic
}

func NewSmithingTable

func NewSmithingTable() *SmithingTable

type Smoker

type Smoker struct {
	*Generic
}

func NewSmoker

func NewSmoker() *Smoker

type Stonecutter

type Stonecutter struct {
	*Generic
}

func NewStonecutter

func NewStonecutter() *Stonecutter

Jump to

Keyboard shortcuts

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