I have found through testing that this can be remedied and fixes the odd way the ears render, through changing the code a little more drastically. I'm not sure when this change came in to play and broke the mau5 ears, but I image it was since layers were introduced.
Note: I created a entirely new Layer to test and fix this. customMau5Ears is simply a new ModelRenderer, and LayerCustomMau5Ears is the entirely new class.
To fix this I first changed the way mau5 ears are created in ModelPlayer to add two boxes as follows:
This creates two separate boxes at the correct positions, rather than creating one box and rendering it twice; this is what creates the odd rotations when you rotate your head quick enough.
Second, I duplicated the renderDeadmau5Ears function to the following:
I have found through testing that this can be remedied and fixes the odd way the ears render, through changing the code a little more drastically. I'm not sure when this change came in to play and broke the mau5 ears, but I image it was since layers were introduced.
Note: I created a entirely new Layer to test and fix this. customMau5Ears is simply a new ModelRenderer, and LayerCustomMau5Ears is the entirely new class.
To fix this I first changed the way mau5 ears are created in ModelPlayer to add two boxes as follows:
This creates two separate boxes at the correct positions, rather than creating one box and rendering it twice; this is what creates the odd rotations when you rotate your head quick enough.
Second, I duplicated the renderDeadmau5Ears function to the following:
This takes the scaling from the original LayerDeadmau5Ears class and handles it here; I guess it really wouldn't matter exactly where this is called.
Third, I made sure the angles were replicated from the head, and set the layer to invisible in the setInvisible function:
Fourth, I created a brand new Layer class that simply implements the LayerRenderer class:
Lastly, I instantiated this new layer in RenderPlayer:
The ears are now fixed; they stick to the head as they used to/should do and I haven't noticed any bugs i.e when sneaking or gliding.