Skip to content

server.internal.gamedata

fn block_network_id_from_nbt #

fn block_network_id_from_nbt(data []u8) !int

fn load #

fn load(data_dir string) !GameData

fn parse_block_palette #

fn parse_block_palette(data []u8) ![]BlockPaletteEntry

struct BlockPaletteEntry #

struct BlockPaletteEntry {
pub:
	name       string
	network_id int
}

BlockPaletteEntry is one block state from the wire palette, in file order. network_id is the exact FNV1a-32 state hash the client expects, read from the palette rather than recomputed, so it can never disagree with vanilla.

struct CreativeGroup #

struct CreativeGroup {
pub:
	category              int
	name                  string
	icon_numeric_id       int
	icon_block_runtime_id int
}

struct CreativeItem #

struct CreativeItem {
pub:
	numeric_id       int
	block_runtime_id int
	meta             int
	group_index      int
}

struct GameData #

struct GameData {
pub:
	item_entries    []ItemEntry
	creative_groups []CreativeGroup
	creative_items  []CreativeItem
	block_palette   []BlockPaletteEntry
pub mut:
	item_id_by_name  map[string]int
	item_id_by_block map[int]int
}

fn (GameData) item_for_block #

fn (d &GameData) item_for_block(block_runtime_id int) int

fn (GameData) item_name #

fn (d &GameData) item_name(id int) string

fn (GameData) item_id #

fn (d &GameData) item_id(name string) int

struct ItemEntry #

struct ItemEntry {
pub:
	name            string
	runtime_id      int
	version         int
	component_based bool
}