Posted February 25, 201312 yr My packets are not sending properly from client to server -- they are staying on the client side. I checked the packet handler with World.isRemote, and it was always called on the client side. If you could help that'd be great. Packet class: http://pastebin.com/suiV6Xx5 Packet handler Class: http://pastebin.com/Wn3YnuRV
February 25, 201312 yr Just to be sure, when isRemote is true then the code is running on the client. I'm writing it, because in your code you're sending packet client -> server. But in the incoming packet code is: if(!world.isRemote){ PacketDispatcher.sendPacketToServer(packet); } ~ On a server side if it is a server side you resend same packet to a server? I compared it to mine packet handling and I can't see anything bad (I'm using getEffectiveSide but world object should carry same information). You can take a look (it's functional code): https://github.com/mnn/jaffas/blob/b6b35d87e3a00b2fa36baf297569982a38fd5250/src/minecraft/monnef/jaffas/food/common/SpawnStonePacketUtils.java https://github.com/mnn/jaffas/blob/b6b35d87e3a00b2fa36baf297569982a38fd5250/src/minecraft/monnef/jaffas/food/common/PacketHandler.java mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
February 26, 201312 yr Author When I added that code to the packet handler it created an infinite loop, which resulted in a stack overflow.
February 26, 201312 yr That code snippet is from your packet handler. If you're talking about my code than you're doing something wrong. My handler uses 2 types of packets and each type is strictly either client->server or server->client, so it's not possible to loop infinitely (one is request for update from client, second is update packet for client. on a second one client does not respond, so there can't be a loop). mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
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.