![Angel of Vengeance](https://media.forgecdn.net/avatars/thumbnails/96/831/256/256/636287359574632162.png)
ClassCastException in AoVUIBar.render() when view entity is not an EntityPlayer
CplPibald opened this issue ยท 2 comments
Minecraft client crashes in AoV hotbar render function when trying to ride a ThermalDynamics viaduct.
When riding a viaduct, ThermalDynamics sets the Minecraft render view entity to a custom Camera entity cofh.thermaldynamics.duct.entity.Camera
. This line in AoVUIBar.render() is triggering a ClassCastException, causing the client to crash.
EntityPlayer entityplayer = (EntityPlayer) mc.getRenderViewEntity();
Recommended fix is to not attempt to render the hotbar when getRenderViewEntity() instanceof EntityPlayer
is false.
Stack trace:
java.lang.ClassCastException: cofh.thermaldynamics.duct.entity.Camera cannot be cast to net.minecraft.entity.player.EntityPlayer
at Tamaized.AoV.gui.client.AoVUIBar.render(AoVUIBar.java:38)
at Tamaized.AoV.gui.client.AoVOverlay.RenderAoVData(AoVOverlay.java:49)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_40_AoVOverlay_RenderAoVData_RenderGameOverlayEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
I tried removing the (EntityPlayer) mc.getRenderViewEntity()
line and that seemed to fix the crash. Per code inspection, the function does not appear to use the entityplayer
variable at all.