Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSchema ¶
RegisterSchema attempts to decode and parse a schema from the provided file reader. The file must follow the correct specification otherwise an error will be returned.
Types ¶
type Block ¶
type Block interface {
// contains filtered or unexported methods
}
Block holds the data that identifies a block. It is implemented by BlockState and BlockMeta.
type BlockMeta ¶
BlockMeta holds the name and metadata value (int16) of a block. This format is used by blocks from Minecraft Bedrock Edition versions before v1.13.
type BlockState ¶
type BlockState struct {
Name string `nbt:"name"`
Properties map[string]any `nbt:"states"`
Version int32 `nbt:"version"`
}
BlockState holds the name, properties and version of a block. The name and properties of the same block may differ, depending on the Version.
func Upgrade ¶
func Upgrade(b Block) BlockState
Upgrade upgrades the given block using the registered block state upgrade schemas. If a Block has not been changed through several versions, Upgrade will simply return the original value. Calling blockupgrader.Upgrade is therefore safe regardless of whether the block is already up-to-date or not.