55import com .google .common .collect .Sets ;
66import com .google .common .graph .GraphBuilder ;
77import com .google .common .graph .MutableGraph ;
8+ import net .minecraft .client .renderer .block .BlockModelShaper ;
89import net .minecraft .client .resources .model .BakedModel ;
910import net .minecraft .client .resources .model .ModelBakery ;
11+ import net .minecraft .client .resources .model .ModelResourceLocation ;
1012import net .minecraft .core .registries .BuiltInRegistries ;
1113import net .minecraft .resources .ResourceLocation ;
12- import net .minecraft .world .item .Item ;
1314import net .minecraft .world .level .block .Block ;
1415import net .minecraft .world .level .block .state .BlockState ;
1516import net .neoforged .fml .ModContainer ;
1617import net .neoforged .fml .ModList ;
1718import net .neoforged .neoforgespi .language .IModInfo ;
1819import org .embeddedt .modernfix .ModernFix ;
19- import org .embeddedt .modernfix .dynamicresources .ModelLocationCache ;
2020import org .embeddedt .modernfix .util .ForwardingInclDefaultsMap ;
2121import org .jetbrains .annotations .Nullable ;
2222
@@ -43,12 +43,10 @@ public ModelBakeEventHelper(Map<ResourceLocation, BakedModel> modelRegistry) {
4343 this .topLevelModelLocations = new HashSet <>(modelRegistry .keySet ());
4444 for (Block block : BuiltInRegistries .BLOCK ) {
4545 for (BlockState state : block .getStateDefinition ().getPossibleStates ()) {
46- topLevelModelLocations .add (ModelLocationCache . get (state ));
46+ topLevelModelLocations .add (BlockModelShaper . stateToModelLocation (state ));
4747 }
4848 }
49- for (Item item : BuiltInRegistries .ITEM ) {
50- topLevelModelLocations .add (ModelLocationCache .get (item ));
51- }
49+ BuiltInRegistries .ITEM .keySet ().forEach (location -> topLevelModelLocations .add (new ModelResourceLocation (location , "inventory" )));
5250 this .dependencyGraph = GraphBuilder .undirected ().build ();
5351 ModList .get ().forEachModContainer ((id , mc ) -> {
5452 this .dependencyGraph .addNode (id );
0 commit comments