Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶ added in v0.9.14
type Item interface { // Count returns the amount of items that is present on the stack. The count is guaranteed never to be // negative. Count() int // Empty checks if the stack is empty (has a count of 0). Empty() bool }
Item represents an item that can be used as either the input or output of an item. These do not necessarily resolve to an actual item, but can be just as simple as a tag etc.
type ItemTag ¶ added in v0.9.14
type ItemTag struct {
// contains filtered or unexported fields
}
ItemTag represents a recipe item that is identified by a tag, such as "minecraft:planks" or "minecraft:digger" and so on.
func NewItemTag ¶ added in v0.9.14
NewItemTag creates a new item tag with the tag and count passed.
type Recipe ¶
type Recipe interface { // Input returns the items required to craft the recipe. Input() []Item // Output returns the items that are produced when the recipe is crafted. Output() []item.Stack // Block returns the block that is used to craft the recipe. Block() string // Priority returns the priority of the recipe. Recipes with lower priority are preferred compared to recipes with // higher priority. Priority() uint32 }
Recipe is implemented by all recipe types.
type Shape ¶
type Shape [2]int
Shape make up the shape of a shaped recipe. It consists of a width and a height.
type Shaped ¶
type Shaped struct {
// contains filtered or unexported fields
}
Shaped is a recipe that has a specific shape that must be used to craft the output of the recipe.
func NewShaped ¶
NewShaped creates a new shaped recipe and returns it. The recipe can only be crafted on the block passed in the parameters. If the block given a crafting table, the recipe can also be crafted in the 2x2 crafting grid in the player's inventory. If nil is passed, the block will be autofilled as a crafting table. The inputs must always match the width*height of the shape.
type Shapeless ¶
type Shapeless struct {
// contains filtered or unexported fields
}
Shapeless is a recipe that has no particular shape.
func NewShapeless ¶
NewShapeless creates a new shapeless recipe and returns it. The recipe can only be crafted on the block passed in the parameters. If the block given a crafting table, the recipe can also be crafted in the 2x2 crafting grid in the player's inventory.
type Smithing ¶ added in v0.9.2
type Smithing struct {
// contains filtered or unexported fields
}
Smithing represents a recipe only craftable on a smithing table.
func NewSmithing ¶ added in v0.9.2
NewSmithing creates a new smithing recipe and returns it. The recipe can only be crafted on the block passed in the parameters. If the block given a crafting table, the recipe can also be crafted in the 2x2 crafting grid in the player's inventory.