legacymappings

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ItemIDByName

func ItemIDByName(name string) (int16, bool)

ItemIDByName returns an item's ID by its name.

func ItemNameByID

func ItemNameByID(id int16) (string, bool)

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

func RuntimeIDToState

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

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

func StateToRuntimeID

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

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

Types

type BlockEntry

type BlockEntry struct {
	// Name is the name of the block. It looks like 'minecraft:stone'.
	Name string
	// RawPayload is the metadata value of the block. A lot of blocks only have 0 as data value, but some blocks
	// carry specific variants or properties encoded in the metadata.
	Data int16
	// LegacyID is the legacy, numerical ID of the block.
	LegacyID int16
}

BlockEntry is a block sent in the StartGame packet block runtime ID table. It holds a name and a metadata value of a block.

func Blocks

func Blocks() []BlockEntry

Blocks returns a slice of all block entries.

func (BlockEntry) Marshal

func (b BlockEntry) Marshal(r protocol.IO)

Marshal ...

type ItemEntry

type ItemEntry struct {
	// Name if the name of the item, which is a name like 'minecraft:stick'.
	Name string
	// LegacyID is the legacy ID of the item. It must point to either an existing item ID or a new one if it
	// seeks to implement a new item.
	LegacyID int16
}

ItemEntry is an item sent in the StartGame item table. It holds a name and a legacy ID, which is used to point back to that name.

func Items

func Items() []ItemEntry

Items returns a slice of all item entries.

func (ItemEntry) Marshal

func (i ItemEntry) Marshal(r protocol.IO)

Marshal ...

Jump to

Keyboard shortcuts

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