class

Minecraft::Data

Inherits Reference < Object

Parsed Minecraft game data for one game version: the raw registries plus the derivations consumers need (block state names, air states, per-state collision shapes).

The constructor is pure — it takes the five JSON documents as strings. Use the Minecraft::Data.load("26.2") macro to build one with the shipped data embedded at compile time.

Constants

DATA_ROOT = "/tmp/tmp.FigfCm/src/src/../data/"
SHIPPED_VERSIONS = ["1.21.8", "1.21.9", "1.21.11", "26.1", "26.2"]

Game versions shipped in data/, in release order.

VERSION = "0.1.0"

Constructors

new(items_json : String, blocks_json : String, materials_json : String, enchantments_json : String, collision_shapes_json : String)
Source

Instance methods

air_states

Set of block state IDs that are air (air, cave_air, void_air)

Source
block_state_collision_shapes

block state nr -> boxes that combine to make up that block state's collision shape

Source
block_state_names

block state nr -> "oak_slab[type=top, waterlogged=true]"

Source
blocks
Source
enchantments
Source
items
Source
materials
Source

Macros

load(version)

Build a Minecraft::Data for one game version, embedding only that version's files. version must be a string literal (or macro-time string expression), e.g. Minecraft::Data.load("26.2").

Source
read_asset(path)

Compile-time embed of one data file. path must be a string literal (or a macro-time string expression), e.g.

Minecraft::Data.read_asset("26.2/entities.json")

Only the files actually referenced get embedded into the binary, so consumers control which versions they ship.

Source

Nested types