Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterGroup ¶ added in v0.10.2
func RegisterGroup(group Group)
RegisterGroup registers a group as a creative group, exposing it in the creative inventory. It can then be referenced using its name when calling RegisterItem.
func RegisterItem ¶
func RegisterItem(item Item)
RegisterItem registers an item as a creative item, exposing it in the creative inventory.
Types ¶
type Category ¶ added in v0.10.2
type Category struct {
// contains filtered or unexported fields
}
Category represents a category of items in the creative inventory which are shown as different tabs.
func ConstructionCategory ¶ added in v0.10.2
func ConstructionCategory() Category
ConstructionCategory is the construction category which contains only blocks that do not fall under any other category.
func EquipmentCategory ¶ added in v0.10.2
func EquipmentCategory() Category
EquipmentCategory is the equipment category which contains tools, armour, food and any other form of equipment.
func ItemsCategory ¶ added in v0.10.2
func ItemsCategory() Category
ItemsCategory is the items category for all the miscellaneous items that do not fall under any other category.
func NatureCategory ¶ added in v0.10.2
func NatureCategory() Category
NatureCategory is the nature category which contains blocks and items that can be naturally found in the world.
type Group ¶ added in v0.10.2
type Group struct {
// Category is the category of the group. It determines the tab in which the group will be displayed in the
// creative inventory.
Category Category
// Name is the localised name of the group, i.e. "itemGroup.name.planks".
Name string
// Icon is the item that will be displayed as the icon of the group in the creative inventory.
Icon item.Stack
}
Group represents a group of items in the creative inventory. Each group has a category, a name and an icon. If either the name or icon is empty, the group is considered an 'anonymous group' and will not group its contents together in the creative inventory.
type Item ¶ added in v0.10.2
type Item struct {
// Stack is the stack of the item that is registered in the creative inventory.
Stack item.Stack
// Group is the name of the group that the item is part of. If two groups are registered with the same
// name, the item will always reside in the first group that was registered.
Group string
}
Item represents a registered item in the creative inventory. It holds a stack of the item and a group that the item is part of.