@@ -992,10 +992,13 @@ def create_models(self, config: ModelData, models_container: NamespaceProxy[Mode
992
992
ret_list .append (m )
993
993
model_def_map [item ] = {
994
994
"type" : "minecraft:special" if special_model else "minecraft:model" ,
995
- "model" : model_compound ["model" ] if special_model else model_name
995
+ "model" : model_compound ["model" ] if special_model else model_name ,
996
996
} | (
997
- {"tints" : t if (t := model_compound .get ("tints" )) else {}}
997
+ {"base" : model_name } if special_model else {}
998
+ ) | (
999
+ {"tints" : t } if (t := model_compound .get ("tints" )) else {}
998
1000
)
1001
+ print (model_def_map )
999
1002
self ._item_def_map .update (model_def_map )
1000
1003
return ret_list
1001
1004
@@ -1015,28 +1018,32 @@ def create_models(self, config: ModelData, models_container: NamespaceProxy[Mode
1015
1018
if not self .forward :
1016
1019
# then we use the vanilla item's model and settings - inheriting from VanillaTemplate for this
1017
1020
item = config .item .entries ()[0 ]
1018
- config_copy = config .copy (update = {"model" : MapOption (__root__ = {config .item .entries ()[0 ]: f"gm4:gui/advancements/{ advancement_name } " })})
1019
- TemplateOptions .create_models (self , config_copy , models_container )
1020
-
1021
- m = models_container [f"gm4:gui/advancements/{ advancement_name } " ] = Model ({
1022
- "parent" : self .forward
1023
- })
1024
- # config.model = MapOption(__root__={config.item.entries()[0]: f"gm4:gui/advancements/{advancement_name}"})
1021
+ config_copy = config .copy (update = {"model" : MapOption (__root__ = {config .item .entries ()[0 ]: f"gm4:gui/advancement/{ advancement_name } " })})
1022
+ m = VanillaTemplate .create_models (self , config_copy , models_container )[0 ]
1023
+
1024
+ else :
1025
+ m = models_container [f"gm4:gui/advancement/{ advancement_name } " ] = Model ({
1026
+ "parent" : self .forward
1027
+ })
1028
+ config .model = MapOption (__root__ = {config .item .entries ()[0 ]: f"gm4:gui/advancement/{ advancement_name } " })
1025
1029
return [m ]
1026
1030
1027
1031
def get_item_def_entry (self , config : ModelData , item : str ):
1028
- if self .tints :
1029
- return {
1030
- "type" : "model" ,
1031
- "model" : config .model .entries ()[0 ],
1032
- "tints" : [
1033
- {
1034
- "type" : "minecraft:constant" ,
1035
- "value" : tint
1036
- }
1037
- for tint in self .tints .entries ()
1038
- ]
1039
- }
1032
+ if not self .forward : # use item def from VanillaTemplate
1033
+ return VanillaTemplate .get_item_def_entry (self , config , item )
1034
+ else :
1035
+ if self .tints :
1036
+ return {
1037
+ "type" : "model" ,
1038
+ "model" : config .model .entries ()[0 ],
1039
+ "tints" : [
1040
+ {
1041
+ "type" : "minecraft:constant" ,
1042
+ "value" : tint
1043
+ }
1044
+ for tint in self .tints .entries ()
1045
+ ]
1046
+ }
1040
1047
return None
1041
1048
1042
1049
def add_namespace (self , namespace : str ):
0 commit comments