Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to course page

Climbing the interface ladder

From basic graphical interfaces to very advanced ones

onPacketData not called

  • 2014-01-04 10:48:35
    i am working on my interface, when my stuff wasn't synchronized. i tested every method by putting system.out.println("works") in it to see if it gets called. and apparently onPacketData in the packet handler doesn't get called. i have registered this class in my @mod class.
    thanks for your help
  • 2014-01-05 01:55:01
    Do you have this under the @Mod part?
    @NetworkMod(channels = {"mychannel"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)

    Do you use the same Channel when sending the packet?
  • 2014-01-05 08:44:24
    yes: @NetworkMod(channels = {ModInfo.MOD_CHANNEL}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)

    how do you mean use the same channel, i thought i only had to tell the channel in the @NetworkMod
  • 2014-01-05 11:34:57
    For example when sending a packet you do:
    PacketDispatcher.sendPacketToServer(PacketDispatcher.getPacket(ModInfo.MOD_CHANNEL, byteStream.toByteArray()));
  • 2014-01-05 20:10:43
    i dont know what you mean by that method. i am still modding in 1.6 fyti :P. here i got the packet handler: http://pastebin.com/aut8hLFb
  • 2014-01-05 21:10:24
    You never actually send the packet. You simply write it to an output stream, then you ignore the data you just write. You need to create and send the packet as well, go back to the examples and you will see what you're missing.
  • 2014-01-09 18:20:26
    aah, i see what you meant by PacketDispatcher.
  • Log in or sign up to reply to this thread