Skip to content

Commit

Permalink
fire event alongside the AddLayers event
Browse files Browse the repository at this point in the history
  • Loading branch information
justliliandev committed May 16, 2023
1 parent e51ac23 commit a6d5724
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
p_114442_.m_85836_();
double d3 = d0 + Mth.m_14139_((double)p_114445_, enderdragonpart.f_19790_, enderdragonpart.m_20185_());
double d4 = d1 + Mth.m_14139_((double)p_114445_, enderdragonpart.f_19791_, enderdragonpart.m_20186_());
@@ -335,9 +_,14 @@
@@ -335,9 +_,15 @@
return this.f_234577_;
}

Expand All @@ -28,5 +28,6 @@
this.f_114362_ = EntityRenderers.m_174049_(entityrendererprovider$context);
this.f_114363_ = EntityRenderers.m_174051_(entityrendererprovider$context);
+ net.minecraftforge.fml.ModLoader.get().postEvent(new net.minecraftforge.client.event.EntityRenderersEvent.AddLayers(f_114362_, f_114363_));
+ net.minecraftforge.client.model.pose.PoseSortingRegistry.init();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ public static void init()
NamedRenderTypeManager.init();
ColorResolverManager.init();
ItemDecoratorHandler.init();
PoseSortingRegistry.init();
}

public static String getArmorTexture(Entity entity, ItemStack armor, String _default, EquipmentSlot slot, String type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ private static void recalculatePoses()

public static void init()
{
poses.clear();
edges.clear();
EntityRenderersEvent.RegisterPoseEvent event = new EntityRenderersEvent.RegisterPoseEvent(PoseSortingRegistry::registerPose);
ModLoader.get().postEventWithWrapInModOrder(event, (mc, e) -> ModLoadingContext.get().setActiveContainer(mc), (mc, e) -> ModLoadingContext.get().setActiveContainer(null));
recalculatePoses();
Expand Down

0 comments on commit a6d5724

Please sign in to comment.