Obfuscate

Obfuscate

34M Downloads

ClassCastException when player does not render PlayerModel

Cheaterpaul opened this issue ยท 1 comments

commented

The Problem is here

if(!MinecraftForge.EVENT_BUS.post(new PlayerModelEvent.Render.Pre((PlayerEntity) entity, (PlayerModel) model, matrixStack, builder, light, overlay, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, Minecraft.getInstance().getRenderPartialTicks())))

This is problematic, because you assume a PlayerModel is rendered for the PlayerEntity, which may not be the case.
This can occur when someone renders the model in RenderPlayerEvent like i do by rendering a WerewolfModel instead of the player model.
https://github.com/TeamLapen/Werewolves/blob/09b51b548217d9a789169e5337b95383c5ceb5ed/src/main/java/de/teamlapen/werewolves/client/core/ClientEventHandler.java#L44

https://github.com/TeamLapen/Werewolves/blob/de3d0eda6fff8eacc32ec38fd81296ab61eef36d/src/main/java/de/teamlapen/werewolves/client/render/WerewolfPlayerRenderer.java#L63

Related crashreport: crash-2021-02-21_17.32.00-client.txt

commented

Is a 1.16.5 fix going to be publicly released?