From b2f643be21be4ed2c40e17147693b44b44b3cdf3 Mon Sep 17 00:00:00 2001 From: gentlegiantJGC Date: Fri, 23 Aug 2024 16:15:03 +0100 Subject: [PATCH] Added support for AND case There was support for the OR case but no support for the AND case --- .../api/resource_pack/java/resource_pack_manager.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/minecraft_model_reader/api/resource_pack/java/resource_pack_manager.py b/minecraft_model_reader/api/resource_pack/java/resource_pack_manager.py index 755fb59..95982b3 100644 --- a/minecraft_model_reader/api/resource_pack/java/resource_pack_manager.py +++ b/minecraft_model_reader/api/resource_pack/java/resource_pack_manager.py @@ -276,6 +276,16 @@ def _get_model(self, block: Block) -> BlockMesh: for prop_match in case["when"]["OR"] ): continue + elif "AND" in case["when"]: + if not all( + all( + block.properties.get(prop, None) + in self.parse_state_val(val) + for prop, val in prop_match.items() + ) + for prop_match in case["when"]["AND"] + ): + continue elif not all( block.properties.get(prop, None) in self.parse_state_val(val)