Minecraft-Console-Client/tools
BruceChen 67ad5fcf97 feat: add palettes for MC 1.21.9/1.21.10 (protocol 773)
- Palette1219.cs: 1053 blocks with new copper chests, copper golem
  statues, copper torches, shelves, oxidized lightning rods, iron chain
- EntityPalette1219.cs: 153 entities (+copper_golem at 27, mannequin at 82)
- ItemPalette1219.cs: 1464 items (generated via gen_item_palette.py)
- EntityMetadataPalette1219.cs: 37 serializers (COMPOUND_TAG removed,
  +CopperGolemState, WeatheringCopperState, ResolvableProfile)
- PacketPalette1219.cs: updated clientbound IDs for 4 new debug packets
  and GameTestHighlightPos, plus config CodeOfConduct/AcceptCodeOfConduct

Also update gen_entity_metadata_palette.py FIELD_TO_ENUM with the three
new serializer type mappings.

Made-with: Cursor
2026-03-21 14:04:56 +08:00
..
diff_registries.py chore: add reusable version adaptation scripts 2026-03-20 01:51:56 +08:00
gen_entity_metadata_palette.py feat: add palettes for MC 1.21.9/1.21.10 (protocol 773) 2026-03-21 14:04:56 +08:00
gen_item_palette.py chore: add reusable version adaptation scripts 2026-03-20 01:51:56 +08:00
README.md chore: add reusable version adaptation scripts 2026-03-20 01:51:56 +08:00

MCC Version Adaptation Tools

Scripts for analyzing Minecraft version differences and generating MCC palette files.

Requires: Python 3.10+, decompiled MC server source in MinecraftOfficial/<version>-decompiled/.

Decompiling a new MC version

cd MinecraftOfficial
java -jar MinecraftDecompiler.jar --version 1.21.4 --side SERVER \
  --decompile --output 1.21.4-remapped.jar --decompiled-output 1.21.4-decompiled

diff_registries.py — Compare registries between versions

Compares Items, EntityTypes, Blocks, DataComponents, and EntityDataSerializers between two MC versions. Reports whether each palette needs updating, lists added/removed entries, and shows ID shift statistics.

python3 tools/diff_registries.py 1.20.6 1.21.1

Output indicates for each registry:

  • IDENTICAL → reuse existing palette
  • PALETTE UPDATE NEEDED → create new palette file + update version routing

gen_item_palette.py — Generate ItemPalette C# file

Reads Items.java field declaration order to generate a complete ItemPaletteXXX.cs.

python3 tools/gen_item_palette.py 1.21.1 121
# → MinecraftClient/Inventory/ItemPalettes/ItemPalette121.cs

Also validates each item name against ItemType.cs and warns about missing enum values.

gen_entity_metadata_palette.py — Generate EntityMetadataPalette C# file

Reads EntityDataSerializers.java static block registration order to generate EntityMetadataPaletteXXX.cs.

python3 tools/gen_entity_metadata_palette.py 1.20.6 1206
# → MinecraftClient/Mapping/EntityMetadataPalettes/EntityMetadataPalette1206.cs

The script maps Java field names to MCC's EntityMetaDataType enum. If a new serializer type appears that isn't in the mapping table, it will warn you to update both the script's FIELD_TO_ENUM dict and MCC's EntityMetaDataType.cs enum.