unascribed / Ears

Faithful fancy fashion features for fuzzy folk.
https://ears.unascribed.com
MIT License
91 stars 15 forks source link

Player heads render incorrectly #64

Open kumquat-ir opened 2 years ago

kumquat-ir commented 2 years ago

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.

unascribed commented 2 years ago

Likely affects other vlegacy versions.

kumquat-ir commented 1 year ago

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