Documentation ¶
Index ¶
- Variables
- func ItemNameToRuntimeID(name string) (runtimeID int32, found bool)
- func ItemRuntimeIDToName(runtimeID int32) (name string, found bool)
- func RuntimeIDToState(runtimeID uint32) (name string, properties map[string]any, found bool)
- func StateToRuntimeID(name string, properties map[string]any) (runtimeID uint32, found bool)
- type State
- type StateHash
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //go:embed block_states.nbt BlockStateData []byte //go:embed item_runtime_ids.nbt ItemRuntimeIDData []byte )
Functions ¶
func ItemNameToRuntimeID ¶
ItemNameToRuntimeID converts a string ID to an item runtime ID.
func ItemRuntimeIDToName ¶
ItemRuntimeIDToName converts an item runtime ID to a string ID.
func RuntimeIDToState ¶
RuntimeIDToState converts a runtime ID to a name and its state properties.
Types ¶
type State ¶
type State struct { // Name is the name of the block. Name string `nbt:"name"` // Properties is a map of properties that define the block's state. Properties map[string]any `nbt:"states"` // Version is the version of the block state. Version int32 `nbt:"version"` }
State holds a combination of a name and properties, together with a version.
type StateHash ¶
type StateHash struct {
Name, Properties string
}
StateHash is a struct that may be used as a map key for block states. It contains the name of the block state and an encoded version of the properties.
func HashState ¶
func HashState(state blockupgrader.BlockState) StateHash
HashState produces a hash for the block properties held by the blockState.
Click to show internal directories.
Click to hide internal directories.