When you place something with your left hand, it will take action with your right hand.
Reproduce:
Do F5 and see your body, Have a torch on left hand, right click on the 'block', and it will use your right hand to place it.
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 34
Attachments
Comments 11
not fixed in <insert minecraft version here>
or
confirmed for <insert minecraft version here>
are usefull
no fix :/
isn't as usefull at all
Please link to this comment in the description
The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.
The reason why this happens is because the method net.minecraft.client.model.ModelBiped.setRotationAngles(float, float, float, float, float, float, Entity)
is using the method net.minecraft.client.model.ModelBiped.getMainHand(Entity)
to determine the hand the animation should play for, which is as the name suggests always the mainhand.
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
//...
if (this.swingProgress > 0.0F)
{
EnumHandSide enumhandside = this.getMainHand(entityIn);
// Added this
if (entityIn instanceof EntityLivingBase && !(((EntityLivingBase) entityIn).field_184622_au == EnumHand.MAIN_HAND)) {
enumhandside = enumhandside.opposite();
}
//...
}
//...
}
Confirmed