Ears icon indicating copy to clipboard operation
Ears copied to clipboard

Player heads render incorrectly

Open kumquat-ir opened this issue 3 years ago • 2 comments

Using Forge 10.13.4.1614 With Ears 1.4.4: 2022-01-20_11 31 11 Without Ears: 2022-01-20_11 31 40

I can reproduce with a fresh 1.7.10 Forge instance, just grab a player head from the creative menu and place it down. Mob heads render correctly.

kumquat-ir avatar Jan 20 '22 16:01 kumquat-ir

Likely affects other vlegacy versions.

unascribed avatar Jan 22 '22 08:01 unascribed

ended up writing a patch to fix this, in a separate mod since i have no idea how to work with this codebase, so here it is, for reference there's already an instance of a ModelSkeletonHead with correct texture dimensions (at least in 1.7, since the zombie texture is 64x64), so use that instead of the 64x32 one

@Patch.Class("net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer")
public class TileEntitySkullRendererTransformer extends MiniTransformer {

	@Patch.Method("func_152674_a(FFFIFILcom/mojang/authlib/GameProfile;)V")
	public void patchRender(PatchContext ctx) {
		ctx.jumpToStart();
		ctx.search(ASTORE(9)).jumpAfter(); // first line of player head branch
		ctx.add( // set skull renderer to the version with correct texture coords for 64x64 textures
			ALOAD(0),
			GETFIELD("net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer", "field_147538_h", "Lnet/minecraft/client/model/ModelSkeletonHead;"),
			ASTORE(8)
		);
	}
}

kumquat-ir avatar May 22 '23 23:05 kumquat-ir