Ears (+ Snouts/Muzzles, Tails, Horns, Wings, and More)

Ears (+ Snouts/Muzzles, Tails, Horns, Wings, and More)

1M Downloads

Player heads render incorrectly

kumquat-ir opened this issue ยท 2 comments

commented

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.

commented

Likely affects other vlegacy versions.

commented

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)
		);
	}
}