|
1 | 1 | package org.embeddedt.modernfix.api.entrypoint; |
2 | 2 |
|
3 | | -import net.minecraft.client.resources.model.BakedModel; |
4 | | -import net.minecraft.client.resources.model.ModelBakery; |
5 | | -import net.minecraft.client.resources.model.ModelState; |
6 | | -import net.minecraft.client.resources.model.UnbakedModel; |
| 3 | +import net.minecraft.client.renderer.texture.TextureAtlasSprite; |
| 4 | +import net.minecraft.client.resources.model.*; |
7 | 5 | import net.minecraft.resources.ResourceLocation; |
8 | 6 |
|
| 7 | +import java.util.function.Function; |
| 8 | + |
9 | 9 |
|
10 | 10 | /** |
11 | 11 | * Implement this interface in a mod class and add it to "modernfix:integration_v1" in your mod metadata file |
@@ -56,7 +56,22 @@ default UnbakedModel onUnbakedModelPreBake(ResourceLocation location, UnbakedMod |
56 | 56 | * with dynamic resources on |
57 | 57 | * @return the model which should actually be loaded for this resource location |
58 | 58 | */ |
| 59 | + @Deprecated |
59 | 60 | default BakedModel onBakedModelLoad(ResourceLocation location, UnbakedModel baseModel, BakedModel originalModel, ModelState state, ModelBakery bakery) { |
60 | 61 | return originalModel; |
61 | 62 | } |
| 63 | + |
| 64 | + /** |
| 65 | + * Called to allow mods to observe the loading of a baked model and either make changes to it or wrap it with their |
| 66 | + * own instance. |
| 67 | + * @param location the ResourceLocation of the model (this may be a ModelResourceLocation) |
| 68 | + * @param originalModel the original model |
| 69 | + * @param bakery the model bakery - do not touch internal fields as they probably don't behave the way you expect |
| 70 | + * with dynamic resources on |
| 71 | + * @param textureGetter function to retrieve textures for this model |
| 72 | + * @return the model which should actually be loaded for this resource location |
| 73 | + */ |
| 74 | + default BakedModel onBakedModelLoad(ResourceLocation location, UnbakedModel baseModel, BakedModel originalModel, ModelState state, ModelBakery bakery, Function<Material, TextureAtlasSprite> textureGetter) { |
| 75 | + return onBakedModelLoad(location, baseModel, originalModel, state, bakery); |
| 76 | + } |
62 | 77 | } |
0 commit comments