Files
libmc/scritps/registries_struct.py
T
RTAkland e47a0bff04 Fix serverbound client command;
Implemented 0x85-ClientboundUpdateRecipesPacket
0x82-ClientboundUpdateAdvancementsPacket
0x6d-ClientboundSetPlayerTeamPacket
0x6c-ClientboundSetPlayerInventorySlotPacket
0x66-ClientboundSetEquipmentPacket
0x60-ClientboundSetCursorItemPacket
0x4a-ClientboundRecipeBookAddPacket
0x3f-ClientboundPlaceGhostRecipePacket
0x34-ClientboundMerchantOffersPacket
0x30-ClientboundLightUpdatePacket
2026-09-11 15:52:22 +08:00

26 lines
692 B
Python

import json
import os
path = "./registries.json"
with open(path, "r") as f:
data = json.loads(f.read())["minecraft:recipe_display"]
sorted_entries = sorted(
data.get('entries', {}).items(),
key=lambda item: item[1].get('protocol_id', 0)
)
for raw_key, value in sorted_entries:
identifier = raw_key.replace('minecraft:', '', 1)
if ':' in identifier:
parts = identifier.split(':', 1)
name_upper = parts[1].upper()
formatted_name = f"{parts[0]}_{name_upper}"
else:
formatted_name = identifier.upper()
proto_id = value.get('protocol_id')
# print(f"{formatted_name}({proto_id}, \"{raw_key}\"),")
print(f"{formatted_name},")