mojira.dev
MC-1545

Player's and Horses head while riding having strange behaviour when looking at the skin in the inventory

As said above, when looking at the own skin in the inventory, the world model's head is moving strangely. Best noticible on mini GUI (and a close look of your character or maybe a big screen).

Related issues

MC-2282 Head glitches while in survival inventory MC-8693 shaking head when open inventory MC-10301 Head violently shakes in third person while in inventory. MC-11649 Head glitches while in inventory MC-15334 Player's head rotates after going in survival inventory (creative) or inventory (survival) MC-16586 Donkey head twitching MC-17264 in the snapshot and you move the horse in the horse's inventory it's head moves in the game MC-18572 Horse head twitches when looking in inventory MC-18950 When opening the inventory while on a horse causes the horses head to turn MC-19793 Head spins while in F5 view in creative mode MC-19798 When I open a tamed horse's GUI and moved my mouse around the screen, the horse's GUI head follows my mouse movements, but then the real horse outside the GUI moves his head as well. MC-20284 While in "Horse Inventory Menu", making your horse follow your mouse makes the horse outside of menu wobble it's head horizontally. MC-20613 a head of a horse spazes out MC-22838 I put f5 two times to see my skin so then I zoomed in all the way that all I could see was my head and pressed the Inventory button then I went to survival Inventory and bam! My head was Derping and twitching!!! real bad!

Attachments

Comments

migrated
[media][media][media]
migrated

To easily reproduce:

  1. Stand close to a tree, facing directly at it.

  2. Press F5 twice to switch to looking at player head, head should be quite large within the window.

  3. Access inventory and observe head in main window. Appears to face backwards, but is glitchy.

kumasasa

Other way:
1. Stand with your back at a tree
2. Press F5 once, back of head will fill whole window
3. -> Inventory, Head flickers

kumasasa

Still reproducible in 1.4.5.
Effect only in survival inventory or in the survival part of the creative inventory.
Apparently this flickering is an interference with the little avatar in the armor section of the inventory.

migrated

@kumasasa: as seen in the video and the description

migrated

Now when riding a horse this bug happens with the horse head aswell and is more noticeable.

migrated

This bug still occurs in 13w24b. It happens in any situation when you open, in the 3rd person view both front and back views, any inventory that have a thumbnail with player's model. You don't need to be ridding a horse, this just makes the bug more noticeable since the inventory window covers a big portion of the screen.

In 1.5.2 and 13w24b, the player's head rotates 45-90ΒΊ towards the mouse pointer and it's likely to shake rapidly depending on the distance between the camera and the player. Upon closing the inventory window, you'll see the head rotating back to its normal position. If you install ShoulderSurfing mod, you can move the camera sideways a bit so you'll be able to see clearly the issue.

It's not something that could harm the gameplay, but it's an issue for those who record videos: it seems the player is having seizure.

My guess is that, there's a conflict between the "preview" model in the inventory and the in-world player's model. Either they should disable any movement of the in-world player's model whist the inventory is open or make both in-world and inventory player's model synchronize with each other. The latter is a more elegant solution, in my opinion.

migrated

Added a screenshot taken with ShoulderSurfing mod which was used to displace the camera/view sideways so that it's easier to see the bug occurring.

migrated

Very easy to fix. Mojang forgot restore after rendering the rotationYawHead field in entity class.
From (Class "GuiInventory" by MCP mapping):

===== START ======
    public static void func_110423_a(int par0, int par1, int par2, float par3, float par4, EntityLivingBase par5EntityLivingBase)
    {
        GL11.glEnable(GL11.GL_COLOR_MATERIAL);
        GL11.glPushMatrix();
        GL11.glTranslatef((float)par0, (float)par1, 50.0F);
        GL11.glScalef((float)(-par2), (float)par2, (float)par2);
        GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
        float var6 = par5EntityLivingBase.renderYawOffset;
        float var7 = par5EntityLivingBase.rotationYaw;
        float var8 = par5EntityLivingBase.rotationPitch;
        GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
        RenderHelper.enableStandardItemLighting();
        GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-((float)Math.atan((double)(par4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
        par5EntityLivingBase.renderYawOffset = (float)Math.atan((double)(par3 / 40.0F)) * 20.0F;
        par5EntityLivingBase.rotationYaw = (float)Math.atan((double)(par3 / 40.0F)) * 40.0F;
        par5EntityLivingBase.rotationPitch = -((float)Math.atan((double)(par4 / 40.0F))) * 20.0F;
        par5EntityLivingBase.rotationYawHead = par5EntityLivingBase.rotationYaw;
        GL11.glTranslatef(0.0F, par5EntityLivingBase.yOffset, 0.0F);
        RenderManager.instance.playerViewY = 180.0F;
        RenderManager.instance.renderEntityWithPosYaw(par5EntityLivingBase, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
        par5EntityLivingBase.renderYawOffset = var6;
        par5EntityLivingBase.rotationYaw = var7;
        par5EntityLivingBase.rotationPitch = var8;
        GL11.glPopMatrix();
        RenderHelper.disableStandardItemLighting();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
    }
====== END =======

To:

===== START ======
    public static void func_110423_a(int par0, int par1, int par2, float par3, float par4, EntityLivingBase par5EntityLivingBase)
    {
        GL11.glEnable(GL11.GL_COLOR_MATERIAL);
        GL11.glPushMatrix();
        GL11.glTranslatef((float)par0, (float)par1, 50.0F);
        GL11.glScalef((float)(-par2), (float)par2, (float)par2);
        GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
        float var6 = par5EntityLivingBase.renderYawOffset;
        float var7 = par5EntityLivingBase.rotationYaw;
        float var8 = par5EntityLivingBase.rotationPitch;
        float savedHeadYaw = par5EntityLivingBase.rotationYawHead;// <----- ADDED THIS LOCAL VARIABLE FOR STORING CURRENT HEAD ROTATION
        GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
        RenderHelper.enableStandardItemLighting();
        GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-((float)Math.atan((double)(par4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
        par5EntityLivingBase.renderYawOffset = (float)Math.atan((double)(par3 / 40.0F)) * 20.0F;
        par5EntityLivingBase.rotationYaw = (float)Math.atan((double)(par3 / 40.0F)) * 40.0F;
        par5EntityLivingBase.rotationPitch = -((float)Math.atan((double)(par4 / 40.0F))) * 20.0F;
        par5EntityLivingBase.rotationYawHead = par5EntityLivingBase.rotationYaw;
        GL11.glTranslatef(0.0F, par5EntityLivingBase.yOffset, 0.0F);
        RenderManager.instance.playerViewY = 180.0F;
        RenderManager.instance.renderEntityWithPosYaw(par5EntityLivingBase, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
        par5EntityLivingBase.renderYawOffset = var6;
        par5EntityLivingBase.rotationYaw = var7;
        par5EntityLivingBase.rotationPitch = var8;
        par5EntityLivingBase.rotationYawHead = savedHeadYaw;//<------ ADDED RESTORING HEAD ROTATION
        GL11.glPopMatrix();
        RenderHelper.disableStandardItemLighting();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
    }
====== END =======

That's all. Fixes both for player and horse.

Moderators, please put code in code tag _
Sorry for long comment

kumasasa

@Ksenofontov Alexander:
Tip: Put
{code}
... here is the code
{code}

migrated

Thanks! Is @jeb_ mean 1.7 as 1.6 release?

migrated

Thank you for fixing it. This bug was screwing up my videos. πŸ™‚

migrated

iiI

It's very good now i have ten hors's

migrated

Confirmed to... 1.2.5. (I found this bug in the past, it was so funny)

migrated

I think this is duplicate of MC-1207, but this ticket covers not only pig riding.

migrated

Jens Bergensten

Confirmed

Minecraft 1.4.1, Minecraft 1.4.2, Minecraft 1.4.5, Minecraft 1.4.6, Minecraft 1.4.7, ..., Snapshot 13w21a, Snapshot 13w21b, Snapshot 13w22a, Minecraft 1.6, Minecraft 1.6.1

Minecraft 1.6.2

Retrieved