37 lines
1013 B
Python
37 lines
1013 B
Python
"""Minecraft 26.3 client data used by the automation layer.
|
|
|
|
The generated data is vendored under ``mosfet/info/data/26.3`` from
|
|
RosegoldMC/minecraft-data.cr (MIT); see that directory's LICENSE.
|
|
"""
|
|
import json
|
|
from pathlib import Path
|
|
from types import SimpleNamespace
|
|
|
|
DATA_VERSION = '26.3'
|
|
DATA_DIR = Path(__file__).resolve().parent / 'data' / DATA_VERSION
|
|
|
|
|
|
def _load(name):
|
|
with (DATA_DIR / name).open(encoding='utf-8') as source:
|
|
return json.load(source)
|
|
|
|
|
|
block_list = _load('blocks.json')
|
|
item_list = _load('items.json')
|
|
entity_list = _load('entities.json')
|
|
materials = _load('materials.json')
|
|
collision_shapes = _load('blockCollisionShapes.json')
|
|
|
|
blocks = {block['name']: block for block in block_list}
|
|
items = {item['name']: item for item in item_list}
|
|
entities = {entity['name']: entity for entity in entity_list}
|
|
|
|
mcd = SimpleNamespace(
|
|
version=DATA_VERSION,
|
|
blocks=blocks,
|
|
items=items,
|
|
entities=entities,
|
|
materials=materials,
|
|
collision_shapes=collision_shapes,
|
|
)
|