Documentation
¶
Index ¶
Constants ¶
View Source
const ( FNV1_32_INIT uint32 = 0x811C9DC5 FNV1_PRIME_32 uint32 = 0x01000193 )
Variables ¶
View Source
var ( // RuntimeIDToState must hold a function to convert a runtime ID to a name and its state properties. RuntimeIDToState func(runtimeID uint32) (name string, properties map[string]any, found bool) // StateToRuntimeID must hold a function to convert a name and its state properties to a runtime ID. StateToRuntimeID func(name string, properties map[string]any) (runtimeID uint32, found bool) )
View Source
var ( // RuntimeIDToIndexState .. RuntimeIDToIndexState func(runtimeID uint32) (result block_general.IndexBlockState, found bool) // IndexStateToRuntimeID .. IndexStateToRuntimeID func(state block_general.IndexBlockState) (runtimeID uint32, found bool) )
View Source
var ( // AirRuntimeID is the runtime ID of an air block. AirRuntimeID uint32 )
Functions ¶
func ComputeBlockHash ¶
ComputeBlockHash compute the hash of block whose name is blockName, and states is blockStates. This implement is edited from https://gist.github.com/Alemiz112/504d0f79feac7ef57eda174b668dd345.
func MarshalInternalData ¶
MarshalInternalData marshal map[string]any{key: value} to its NBT represent. Note that only the internal results are returned, and the outer ones are not included.
For example, if key is "12" whose bytes is []byte{49, 50}, and value is int32(7), then the return result is []byte{3, 2, 0, 49, 50, 7, 0, 0, 0} but not []byte{10, 0, 0, 3, 2, 0, 49, 50, 7, 0, 0, 0, 0}.
The explanation of the example:
- 3 => The type of value is TAG_Int (3)
- 2, 0 => The length of key ("12") is 2 (little endian represent)
- 49, 50 => The content of key ("12")
- 7, 0, 0, 0 => The little endian represent of value (7)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.