Jump to content

[1.3.2] Mounting Entitites [UNSOLVED]


fisherman77

Recommended Posts

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;
       }

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.