From 643fcb98c0e6cdc63218dd39960d9053b209d9a6 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Tue, 30 Sep 2025 10:56:34 -0500 Subject: 1.21.9 (#235) * start updating to 25w33a * 1.21.9-pre2 * clippy * cleanup, and fix c_explode and c_player_rotation * mc update should be in Changed section in the changelog * 1.21.9 --- codegen/lib/code/data_components.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'codegen/lib/code/data_components.py') diff --git a/codegen/lib/code/data_components.py b/codegen/lib/code/data_components.py index d29096d2..bba952e1 100644 --- a/codegen/lib/code/data_components.py +++ b/codegen/lib/code/data_components.py @@ -315,6 +315,18 @@ use crate::{ list(python_value.values())[0], target_rust_type ) return str(python_value) + elif target_rust_type == "NbtCompound": + # NbtCompound::from_values([ + # ("id".into(), "minecraft:allay".into()), + # ]), + t = "NbtCompound::from_values(vec![" + for k, v in python_value.items(): + if isinstance(v, str): + t += f'("{k}".into(), "{v}".into()),' + else: + t += f'("{k}".into(), {python_to_rust_value(v, "FIXME_UNKNOWN_NBT")}),' + t = t.rstrip(",") + "])" + return t if isinstance(python_value, dict): if target_rust_type == "ResourceLocation" and len(python_value) == 1: -- cgit v1.2.3