Skip to content

Commit

Permalink
Fix entity.rotationYaw not being synced within body parts with use ta…
Browse files Browse the repository at this point in the history
…rget
  • Loading branch information
mchorse committed Feb 5, 2022
1 parent e78a88d commit 2960d02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/mchorse/metamorph/bodypart/BodyPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,23 @@ public void render(AbstractMorph parent, EntityLivingBase entity, float partialT

GL11.glScalef(sx, sy, sz);

float yaw = entity.rotationYaw;
float prevYaw = entity.prevRotationYaw;
float rotationYaw = entity.renderYawOffset;
float prevRotationYaw = entity.prevRenderYawOffset;
float rotationYawHead = entity.rotationYawHead;
float prevRotationYawHead = entity.prevRotationYawHead;

entity.rotationYaw = entity.rotationYaw - entity.renderYawOffset;
entity.prevRotationYaw = entity.prevRotationYaw - entity.prevRenderYawOffset;
entity.rotationYawHead = entity.rotationYawHead - entity.renderYawOffset;
entity.prevRotationYawHead = entity.prevRotationYawHead - entity.prevRenderYawOffset;
entity.renderYawOffset = entity.prevRenderYawOffset = 0;

MorphUtils.render(this.morph.get(), entity, 0, 0, 0, 0, partialTicks);

entity.rotationYaw = yaw;
entity.prevRotationYaw = prevYaw;
entity.renderYawOffset = rotationYaw;
entity.prevRenderYawOffset = prevRotationYaw;
entity.rotationYawHead = rotationYawHead;
Expand Down

0 comments on commit 2960d02

Please sign in to comment.