Skip to content

Conversation

@vberlier
Copy link

Beet is upgrading to Pydantic v2. I wanted to make sure that the changes on the beta branch don't break anything so I decided to try to build gm4 with it. And with this PR I'm successfully building everything:

$ uv run beet -p beet-release.yaml

The dev command seems to work as well.

Nearly all of the changes I had to make were related to Pydantic. Some things to note:

  • I had to patch some overlay handling in the backwards compatibility plugin (crash when overlay_formats is None). This is most likely from recent changes on beet's main branch that weren't accounted for in gm4 yet.
  • skin_cache.json got updated, not sure why?
  • In Pydantic v2 nullability no longer implies that the field can be omitted. We need explicit None default values.
  • I had to convert the validation of TemplateOptions, TransformOptions, and ContainerGuiOptions to a sort of dynamic discriminated union.
  • Pydantic v2 doesn't include fields from derived classes when converting to a dict if you don't specify serialize_as_any=True.
  • Pydantic's ValidationError changed and I couldn't easily convert the code responsible for aggregating and prefixing errors from NestedModelData validation. Now, if there are errors, only the first one is shown.

Feel free to polish this up, or just use the PR as a guide and completely re-do things your way.

@SpecialBuilder32
Copy link
Member

Thanks VB! Like 2 years ago I took a stab at updating our admittedly complex RP build process to pydantic 2.... And everything broke very badly. I'll dig up my old branch and compare notes, hopefully get this working pretty soon.

There's complexity in our config broadcast system for item models, to prevent repeating the same lines in config for every item variant.

@vberlier
Copy link
Author

Here's the manifest generated by the release build on my machine release\1.21.5\meta.json
Do you think you could check if it's still the same?

@vberlier
Copy link
Author

vberlier commented Nov 17, 2025

Alright, the manifests don't match. All modules hashes are different.

All pack.mcmeta have changes:

--- a/baseline/gm4_bat_grenades_1_21_5/pack.mcmeta
+++ b/baseline/gm4_bat_grenades_1_21_5/pack.mcmeta
@@ -1,6 +1,13 @@
 {
   "pack": {
-    "pack_format": 71,
+    "min_format": [
+      88,
+      0
+    ],
+    "max_format": [
+      88,
+      0
+    ],
     "description": [
       "Bat Grenades",
       "\n",
@@ -9,11 +16,12 @@
         "color": "#4AA0C7"
       }
     ],
+    "pack_format": 71,
     "supported_formats": {
       "min_inclusive": 71,
       "max_inclusive": 81
     }
   },
   "version": "1.6.0",
-  "commit_hash": "cb0fe4537"
+  "commit_hash": "14118d19"
 }

The added min_format and max_format are from beet's main branch.

All png files have changes. The png files are visually identical but the new python/pillow version probably changed the encoding/compression slightly.

All structure files have changes. The nbt data is the same, but again the files likely differ due to minor adjustments in python's compression libraries.

Some changes to gm4_resource_pack_1_21_5/assets/gm4_translations/lang/en_us.json. There's some minor reordering but it looks like a few translations were previously missing? e.g. block.gm4.custom_crafter

Some changes in most item models. It looks like it's fixing a potential issue where you currently get redundant entries? For example the previous version of gm4_resource_pack_1_21_5/assets/minecraft/items/player_head.json doesn't reference cool_empty, hot_empty and cool_metal anywhere.

--- a/baseline/gm4_resource_pack_1_21_5/assets/minecraft/items/player_head.json
+++ b/baseline/gm4_resource_pack_1_21_5/assets/minecraft/items/player_head.json
@@ -162,7 +162,7 @@
           "model": {
             "type": "minecraft:player_head"
           },
-          "base": "gm4_metallurgy:block/mould/hot_metal"
+          "base": "gm4_metallurgy:block/mould/cool_empty"
         }
       },
       {
@@ -172,7 +172,7 @@
           "model": {
             "type": "minecraft:player_head"
           },
-          "base": "gm4_metallurgy:block/mould/hot_metal"
+          "base": "gm4_metallurgy:block/mould/hot_empty"
         }
       },
       {
@@ -182,7 +182,7 @@
           "model": {
             "type": "minecraft:player_head"
           },
-          "base": "gm4_metallurgy:block/mould/hot_metal"
+          "base": "gm4_metallurgy:block/mould/cool_metal"
         }
       },
       {

That's all the changes I gathered from the release output.

@Bloo-dev Bloo-dev added the tool This is related to our build pipeline label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool This is related to our build pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants