The bug
When a player named "deadmau5" sneaks or flies with an elytra (and rotates his head), his ears are offset.
How to reproduce
Copy the latest version folder in the
.minecraft\versions
directory and append_custom
to the copied name, resulting in for example1.12-pre5_custom
Delete the
.jar
file inside the folderAppend
_custom
to the version.json
file name as wellReplace the content of the version
.json
file with the following{ "id": "#VERSION#_custom", "time": "2038-01-19T03:14:07+00:00", "releaseTime": "2038-01-19T03:14:07+00:00", "type": "snapshot", "minecraftArguments": "--username deadmau5 --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid 1e18d5ff643d45c8b50943b8461d8614 --accessToken ${auth_access_token} --userType ${user_type} --versionType ${version_type}", "inheritsFrom": "#VERSION#", "jar": "#VERSION#" }
Replace all occurrences of
#VERSION#
with the version id you created a copy of, for example1.12-pre5
Select this version in the launcher and start the game
Switch to third person view (
F5
) and sneak
Code analysis
by @unknown
The method net.minecraft.client.renderer.entity.layers.LayerDeadmau5Head.doRenderLayer()
doesn't check if the to be rendered entity is sneaking. Thus, a simple way to fix the sneaking issue would be to add that specific check, which translates the ears a bit down. (I don't know the exact "sneak-shrink"-value, 0.25F is just an example!)
net.minecraft.client.renderer.entity.layers.LayerDeadmau5Head.doRenderLayer()
// ...
if(entitylivingbaseIn.isSneaking()) {
GlStateManager.translate(0F, 0.25F, 0F);
}
float f2 = 1.3333334F;
GlStateManager.scale(1.3333334F, 1.3333334F, 1.3333334F);
this.playerRenderer.getMainModel().renderDeadmau5Head(0.0625F);
// ...
The fix I found for the elytra-flying issue is very similar to my proposed fix on MC-75279 – clamping the pitch of the ears does the job. Again, the values (-30F, -60F) are only examples, there may be other, way better values to use here.
net.minecraft.client.renderer.entity.layers.LayerDeadmau5Head.doRenderLayer()
// ...
float f1 = entitylivingbaseIn.prevRotationPitch + (entitylivingbaseIn.rotationPitch - entitylivingbaseIn.prevRotationPitch) * partialTicks;
GlStateManager.pushMatrix();
if(entitylivingbaseIn.isElytraFlying()) {
f1 = MathHelper.clamp(f1, -60F, -30F);
}
// ...
Note: I do not own the username "deadmau5" neither do I know the person owning it personally. The attached screenshots were created by using "deadmau5" as username. The screenshots were taken for testing purposes.
Linked issues
relates to 1
Attachments
Comments 16
Yes, they are offset when you rotate your head (pitch) while flying. The look also pretty strange when you rotate your head very fast.
What happens when gliding?