Crash with Morph (BlockConcrete ClassCastException)
SanAndreaP opened this issue ยท 4 comments
Minecraft: 1.7.10
Forge: 10.13.4.1492
Chisel: 2.9.1.6
Morph: 0.9.2
So, when I try morphing into another creature, the game crashes with following error message:
java.lang.ClassCastException: net.minecraft.client.entity.EntityOtherPlayerMP cannot be cast to net.minecraft.client.entity.EntityPlayerSP
at team.chisel.block.BlockConcrete.speedupPlayer(BlockConcrete.java:34)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_BlockConcrete_speedupPlayer_PlayerTickEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
at cpw.mods.fml.common.FMLCommonHandler.onPlayerPreTick(FMLCommonHandler.java:345)
at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:220)
at net.minecraft.client.entity.EntityOtherPlayerMP.func_70071_h_(EntityOtherPlayerMP.java:59)
at morph.client.core.TickHandlerClient.worldTick(TickHandlerClient.java:851)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_46_TickHandlerClient_worldTick_ClientTickEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138)
at cpw.mods.fml.common.FMLCommonHandler.onPostClientTick(FMLCommonHandler.java:330)
at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:2064)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Here's the complete log:
https://gist.github.com/SanAndreasP/b5ccf89c4f4324f80ba4
@iChun wat r u doin
I'll add in some safeguards for this kind of thing, though I'm not sure how exactly it could happen.
I create a fake player (EntityOtherPlayerMP) for use of rendering and I call it's onUpdate function so stuff like particles and such would be spawned. EntityOtherPlayerMP doesn't extend EntityPlayerSP, the only instance of EntityPlayerSP is normally the minecraft player.
This was fixed in 3fb1fc3