mappings

package
v0.0.0-...-b1a0a32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MVBlockMapping

type MVBlockMapping struct {

	// LegacyAirRID is the runtime ID of the air block of that mapping.
	LegacyAirRID uint32
	// contains filtered or unexported fields
}

MVBlockMapping holds all data blocks related.

func (MVBlockMapping) Blocks

func (m MVBlockMapping) Blocks() []protocol.BlockEntry

Blocks returns a slice of all block entries.

func (MVBlockMapping) RuntimeIDToState

func (m MVBlockMapping) RuntimeIDToState(runtimeID uint32) (name string, properties map[string]any, found bool)

RuntimeIDToState converts a runtime ID to a name and its state properties.

func (MVBlockMapping) StateToRuntimeID

func (m MVBlockMapping) StateToRuntimeID(name string, properties map[string]any) uint32

StateToRuntimeID converts a name and its state properties to a runtime ID.

type MVItemMapping

type MVItemMapping struct {
	// contains filtered or unexported fields
}

MVItemMapping holds all data items related.

func (MVItemMapping) ItemIDByName

func (m MVItemMapping) ItemIDByName(name string) (int32, bool)

ItemIDByName returns an item's ID by its name.

func (MVItemMapping) ItemNameByID

func (m MVItemMapping) ItemNameByID(id int32) (string, bool)

ItemNameByID returns an item's name by its legacy ID.

func (MVItemMapping) Items

func (m MVItemMapping) Items() []protocol.ItemEntry

Items returns a slice of all item entries.

func (MVItemMapping) Recipes

func (m MVItemMapping) Recipes() []protocol.Recipe

Recipes returns a slice of all recipes.

type MVMapping

type MVMapping struct {
	MVBlockMapping
	MVItemMapping
}

MVMapping holds all data blocks, items related.

func Mapping

func Mapping(blockStateData, itemRuntimeIDData []byte, oldFormat bool) MVMapping

Mapping returns MVMapping instance of all block and item entries and values in the maps from the resource JSON.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL