Port dynres change to 1.19.4+
This commit is contained in:
parent
0ce00531a6
commit
8cc5785e86
|
|
@ -66,6 +66,8 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
|
||||||
@Shadow
|
@Shadow
|
||||||
public abstract void loadTopLevel(ModelResourceLocation modelResourceLocation);
|
public abstract void loadTopLevel(ModelResourceLocation modelResourceLocation);
|
||||||
|
|
||||||
|
@Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation);
|
||||||
|
|
||||||
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
|
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
|
||||||
|
|
||||||
private Cache<ResourceLocation, UnbakedModel> loadedModels;
|
private Cache<ResourceLocation, UnbakedModel> loadedModels;
|
||||||
|
|
@ -255,7 +257,7 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
|
||||||
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
|
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
|
||||||
try {
|
try {
|
||||||
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
|
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
|
||||||
result.getMaterials(this::getModel, new HashSet<>());
|
result.resolveParents(this::getModel);
|
||||||
} catch(RuntimeException ignored) {}
|
} catch(RuntimeException ignored) {}
|
||||||
// We are done with loading, so clear this cache to allow GC of any unneeded models
|
// We are done with loading, so clear this cache to allow GC of any unneeded models
|
||||||
if(mfix$nestedLoads == 0)
|
if(mfix$nestedLoads == 0)
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,9 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
|
||||||
|
|
||||||
@Shadow @Final @Mutable private BlockColors blockColors;
|
@Shadow @Final @Mutable private BlockColors blockColors;
|
||||||
@Shadow @Final private static Logger LOGGER;
|
@Shadow @Final private static Logger LOGGER;
|
||||||
|
|
||||||
|
@Shadow public abstract UnbakedModel getModel(ResourceLocation resourceLocation);
|
||||||
|
|
||||||
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
|
private Cache<ModelBakery.BakedCacheKey, BakedModel> loadedBakedModels;
|
||||||
|
|
||||||
private Cache<ResourceLocation, UnbakedModel> loadedModels;
|
private Cache<ResourceLocation, UnbakedModel> loadedModels;
|
||||||
|
|
@ -236,7 +239,7 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery {
|
||||||
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
|
UnbakedModel result = smallLoadingCache.getOrDefault(modelLocation, iunbakedmodel);
|
||||||
try {
|
try {
|
||||||
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
|
// required as some mods (e.g. EBE) call bake directly on the returned model, without resolving parents themselves
|
||||||
result.getMaterials(this::getModel, new HashSet<>());
|
result.resolveParents(this::getModel);
|
||||||
} catch(RuntimeException ignored) {}
|
} catch(RuntimeException ignored) {}
|
||||||
// We are done with loading, so clear this cache to allow GC of any unneeded models
|
// We are done with loading, so clear this cache to allow GC of any unneeded models
|
||||||
if(mfix$nestedLoads == 0)
|
if(mfix$nestedLoads == 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user