Ears (+ Snouts/Muzzles, Tails, Horns, Wings, and More)

Ears (+ Snouts/Muzzles, Tails, Horns, Wings, and More)

1M Downloads

Incompatibility with Smart Moving and RenderPlayerAPI

makamys opened this issue ยท 1 comments

commented

The issue

  • When Smart Moving is installed, the player model remains the vanilla one, just with the texture messed up, and an additional pair of (slim) arms being rendered. Ears parts still show up correctly.
    2021-09-01_02 06 05

  • When RenderPlayerAPI is installed, the game crashes when loading a world, since RenderPlayerAPI is trying to cast RenderPlayer.modelBipedMain to its api.player.model.ModelPlayer class, which fails since in amendPlayerRenderer Ears had replaced it with a new ModelBiped instance.

For more context on the second problem, this is what RenderPlayer() looks like with Ears and RenderPlayerAPI both present.

   public RenderPlayer() {
      super(new ModelPlayer(0.0F, "main"), 0.5F);
      RenderPlayerAPI.beforeLocalConstructing(this);
      this.field_77109_a = (ModelBiped)this.field_77045_g;
      this.field_77108_b = new ModelPlayer(1.0F, "chestplate");
      this.field_77111_i = new ModelPlayer(0.5F, "armor");
      Ears.amendPlayerRenderer(this);
      RenderPlayerAPI.afterLocalConstructing(this);
   }

How to fix

These incompatibilities can be fixed in the following way: all ModelBiped and ModelRenderer instances must be modified in-place. See How-to-make-an-existing-mod-compatible-with-Smart-Moving for more details.

As a proof of concept I hacked 64x64 texture support into the right arm in this way. I can confirm this makes the right arm show up correctly with Smart Moving and RenderPlayerAPI installed.
https://gist.github.com/makamys/a248117e7a505764cfb0575119e9d12e

For the slim/fat arms, remember that child models can have their visibility toggled individually, so you could keep both types of arms inside a single ModelRenderer.

Edit: I realized this method may not work correctly in multiplayer when multiple player models are present, further research is needed.

commented

I'm having a similar problem with SmartMoving/PlayerAPI in MCv1.2.5 -- should I make a new thread or just add it on here?
image
image
image
image