Simply Jetpacks 2

Simply Jetpacks 2

50M Downloads

Client crash with living non-player entities

LemADEC opened this issue ยท 1 comments

commented

As of 1.12.2-2.2.18.1, a client crash happens when watching living non-player entity wearing a jetpack. This can be reproduced with WarpDrive offline avatar, as seen here:

java.lang.ClassCastException: cr0s.warpdrive.entity.EntityOfflineAvatar cannot be cast to net.minecraft.entity.player.EntityPlayer
    at tonius.simplyjetpacks.client.handler.ClientTickHandler.tickEnd(ClientTickHandler.java:76)
    at tonius.simplyjetpacks.client.handler.ClientTickHandler.onClientTick(ClientTickHandler.java:115)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_2672_ClientTickHandler_onClientTick_ClientTickEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.fml.common.FMLCommonHandler.onPostClientTick(FMLCommonHandler.java:349)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1911)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1098)
    at net.minecraft.client.Minecraft.run(Minecraft.java:3942)
    at net.minecraft.client.main.Main.main(SourceFile:123)
    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:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

From a quick code review, here https://github.com/Tomson124/SimplyJetpacks2/blob/1.12/src/main/java/tonius/simplyjetpacks/client/handler/ClientTickHandler.java#L76 , we can see a cast to EntityPlayer while entity was only sanitized against EntityLivingBase .

commented