Fix #5805 ModelBakeEvent does not fire
This commit is contained in:
parent
a14c2233e0
commit
5fb948fb35
4 changed files with 14 additions and 5 deletions
|
@ -26,3 +26,11 @@
|
|||
p_212854_2_.func_219897_b();
|
||||
return modelbakery;
|
||||
}
|
||||
@@ -47,6 +53,7 @@
|
||||
p_212853_1_.func_217844_a(p_212853_3_);
|
||||
this.field_174958_a = p_212853_1_.func_217846_a();
|
||||
this.field_174955_d = this.field_174958_a.get(ModelBakery.field_177604_a);
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, (net.minecraftforge.client.model.ModelLoader) p_212853_1_);
|
||||
p_212853_3_.func_219895_b("cache");
|
||||
this.field_174957_c.func_178124_c();
|
||||
p_212853_3_.func_76319_b();
|
||||
|
|
|
@ -371,7 +371,7 @@ public class ForgeHooksClient
|
|||
MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(fogRenderer, renderer, info, partial, mode, distance));
|
||||
}
|
||||
|
||||
public static void onModelBake(ModelManager modelManager, Map<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
public static void onModelBake(ModelManager modelManager, Map<ResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new ModelBakeEvent(modelManager, modelRegistry, modelLoader));
|
||||
modelLoader.onPostBakeEvent(modelRegistry);
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Map;
|
|||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ModelManager;
|
||||
import net.minecraft.client.renderer.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
/**
|
||||
|
@ -34,10 +35,10 @@ import net.minecraftforge.client.model.ModelLoader;
|
|||
public class ModelBakeEvent extends net.minecraftforge.eventbus.api.Event
|
||||
{
|
||||
private final ModelManager modelManager;
|
||||
private final Map<ModelResourceLocation, IBakedModel> modelRegistry;
|
||||
private final Map<ResourceLocation, IBakedModel> modelRegistry;
|
||||
private final ModelLoader modelLoader;
|
||||
|
||||
public ModelBakeEvent(ModelManager modelManager, Map<ModelResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
public ModelBakeEvent(ModelManager modelManager, Map<ResourceLocation, IBakedModel> modelRegistry, ModelLoader modelLoader)
|
||||
{
|
||||
this.modelManager = modelManager;
|
||||
this.modelRegistry = modelRegistry;
|
||||
|
@ -49,7 +50,7 @@ public class ModelBakeEvent extends net.minecraftforge.eventbus.api.Event
|
|||
return modelManager;
|
||||
}
|
||||
|
||||
public Map<ModelResourceLocation, IBakedModel> getModelRegistry()
|
||||
public Map<ResourceLocation, IBakedModel> getModelRegistry()
|
||||
{
|
||||
return modelRegistry;
|
||||
}
|
||||
|
|
|
@ -943,7 +943,7 @@ public final class ModelLoader extends ModelBakery
|
|||
/**
|
||||
* Internal, do not use.
|
||||
*/
|
||||
public void onPostBakeEvent(Map<ModelResourceLocation, IBakedModel> modelRegistry)
|
||||
public void onPostBakeEvent(Map<ResourceLocation, IBakedModel> modelRegistry)
|
||||
{
|
||||
IBakedModel missingModel = modelRegistry.get(MODEL_MISSING);
|
||||
for(Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet())
|
||||
|
|
Loading…
Reference in a new issue