Posted September 14, 201213 yr Hello! I have recently upgraded to the new Forge and MC 1.3.2. However, I can not get this one little bug squashed! Here is the error log: 2012-09-14 17:30:19 [sEVERE] [ForgeModLoader] A critical server error occured handling a packet, kicking net.minecraft.src.NetServerHandler@111de95a java.lang.ClassCastException: net.minecraft.src.EntityPlayerMP cannot be cast to net.minecraft.src.EntityPlayerSP at fisherman77.Zeuscraft.common.EntityPegasus.onUpdate(EntityPegasus.java:200) at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2027) at net.minecraft.src.WorldServer.uncheckedUpdateEntity(WorldServer.java:547) at net.minecraft.src.NetServerHandler.handleFlying(NetServerHandler.java:186) at net.minecraft.src.Packet10Flying.processPacket(Packet10Flying.java:51) at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:75) at net.minecraft.src.NetServerHandler.networkTick(NetServerHandler.java:72) at net.minecraft.src.NetworkListenThread.networkTick(NetworkListenThread.java:55) at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:111) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:630) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547) at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:105) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:453) at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17) and here is the effected lines: public void onUpdate() { super.onUpdate(); if(riddenByEntity != null) { EntityPlayerSP entityplayersp = (EntityPlayerSP)riddenByEntity; double uplift = 0.45500000000000002D; if (entityplayersp.movementInput.jump) { motionY = 0.1D; } if (entityplayersp.movementInput.sneak) { motionY = -0.1D; }
September 15, 201213 yr That riddenByEntity variable is a EntityPlayerMP object. However, you are trying to cast it to a EntityPlayerSP, which is impossible. Try to use another way
September 15, 201213 yr IIRC, functions like that get called twice- once with a EntityPlayer, and once with a EntityPlayerMP (or something like that.) But I'm not sure if that'll help. What about registering key-bindings? BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
September 16, 201213 yr IIRC, functions like that get called twice- once with a EntityPlayer, and once with a EntityPlayerMP (or something like that.) But I'm not sure if that'll help. What about registering key-bindings? Dude, the registering is probably fine, because if you look at the crashlog, it'll tell you that he's trying an invalid type-cast. That's probably his main problem now.
September 16, 201213 yr Author Thanks for the help so far! However, I do still have a problem with EntityPlayerMP casting into itself for that line: java.lang.ClassCastException: net.minecraft.src.EntityClientPlayerMP cannot be cast to net.minecraft.src.EntityPlayerMP 2012-09-16 10:35:08 [iNFO] [sTDERR] at fisherman77.Zeuscraft.common.EntityPegasus.onUpdate(EntityPegasus.java:202) 2012-09-16 10:35:08 [iNFO] [sTDERR] at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2027) 2012-09-16 10:35:08 [iNFO] [sTDERR] at net.minecraft.src.World.updateEntity(World.java:1992) 2012-09-16 10:35:08 [iNFO] [sTDERR] at net.minecraft.src.World.updateEntities(World.java:1873) 2012-09-16 10:35:08 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1771) 2012-09-16 10:35:08 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:834) 2012-09-16 10:35:08 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:764) 2012-09-16 10:35:08 [iNFO] [sTDERR] at java.lang.Thread.run(Thread.java:680) BTW, I changed the ascending and descending by using this code (this also includes the most current code): EntityPlayerMP entityplayermp = (EntityPlayerMP)riddenByEntity; double uplift = 0.45500000000000002D; /* if (entityplayersp.movementInput.jump) { motionY = 0.1D; } if (entityplayersp.movementInput.sneak) { motionY = -0.1D; } */ motionY = riddenByEntity.motionY * uplift; Should I try keybindings? If so, could you direct me to a good tut?
September 16, 201213 yr java.lang.ClassCastException: net.minecraft.src.EntityClientPlayerMP cannot be cast to net.minecraft.src.EntityPlayerMP Have you read this very carefully? Because you would've noticed that this doesn't cast to itself, but it casts a EntityClientPlayerMP to a EntityPlayerMP (see the Client in the first one?) I have no idea how to fix this though...
September 18, 201213 yr Author Ya. I also tried EntityPlayerClientMP, or whatever it was that was mentioned in this post above, and it gave me the exact same error, which is peculiar.
September 19, 201213 yr Author Ya I think I fixed it for the controlling for the most part, but now I am just getting a packet error - the server suspects cheating? 2012-09-18 19:37:15 [sEVERE] [ForgeModLoader] A critical server error occured handling a packet, kicking net.minecraft.src.NetServerHandler@75d7d567 java.lang.NullPointerException at fisherman77.Zeuscraft.common.EntityPegasus.updateEntityActionState(EntityPegasus.java:110) at net.minecraft.src.EntityLiving.onLivingUpdate(EntityLiving.java:1537) at net.minecraft.src.EntityLiving.onUpdate(EntityLiving.java:687) at fisherman77.Zeuscraft.common.EntityPegasus.onUpdate(EntityPegasus.java:249) at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:2027) at net.minecraft.src.WorldServer.uncheckedUpdateEntity(WorldServer.java:547) at net.minecraft.src.NetServerHandler.handleFlying(NetServerHandler.java:186) at net.minecraft.src.Packet10Flying.processPacket(Packet10Flying.java:51) at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:75) at net.minecraft.src.NetServerHandler.networkTick(NetServerHandler.java:72) at net.minecraft.src.NetworkListenThread.networkTick(NetworkListenThread.java:55) at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:111) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:630) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547) at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:105) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:453) at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)
September 19, 201213 yr Maybe you should add a check to make sure there isn't a NullPointer. Thid line: EntityPegasus.java:110 has an error, because you try to use a variable which holds the value "null". Just make sure it isn't null when you use it, like so: if(var != null) { // Code Here }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.