Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

are you usign 2 different packet handlers ? (1 server, 1 client) and can you debug a little, try to see where its failing, can you register correctly server side ? can you send the packet successfully ? is the server receiving the packet ?, is the server passing all the condition to spawn the item ?  is the item being spawned ?

 

see my debug guide in my sig

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

you create 2 class that implements IPacketHandler

one with the server code and one with the client code

 

and register them like this:

IPacketHandler phs = new ServerPacketHandler();
IPacketHandler phc = new ClientPacketHandler();
NetworkRegistry.instance().registerChannel(phs, "FRG", Side.SERVER);
NetworkRegistry.instance().registerChannel(phc, "FRG", Side.CLIENT);

 

also remove every related thing in your @NetworkMod , aka

@NetworkMod(clientSideRequired = true, serverSideRequired = true, clientPacketHandlerSpec = @SidedPacketHandler(channels = {

"FRG" }, packetHandler = ForgeRevClientPacketHandler.class))

leave only

@NetworkMod(clientSideRequired = true, serverSideRequired = true)

because if you have it in your @NetworkMod and a code version (describe above) it will resgister it twice. use only the code version because its easier to understand what its doing.

 

i understand why they use annotation but i think its more confusing then anything else :\, specially for newbie (not saying you're a newbie, just saying in general it's not a really used concept in java even though it exists)

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

you create 2 class that implements IPacketHandler

one with the server code and one with the client code

 

and register them like this:

IPacketHandler phs = new ServerPacketHandler();
IPacketHandler phc = new ClientPacketHandler();
NetworkRegistry.instance().registerChannel(phs, "FRG", Side.SERVER);
NetworkRegistry.instance().registerChannel(phc, "FRG", Side.CLIENT);

 

also remove every related thing in your @NetworkMod , aka

@NetworkMod(clientSideRequired = true, serverSideRequired = true, clientPacketHandlerSpec = @SidedPacketHandler(channels = {

"FRG" }, packetHandler = ForgeRevClientPacketHandler.class))

leave only

@NetworkMod(clientSideRequired = true, serverSideRequired = true)

because if you have it in your @NetworkMod and a code version (describe above) it will resgister it twice. use only the code version because its easier to understand what its doing.

 

i understand why they use annotation but i think its more confusing then anything else :\, specially for newbie (not saying you're a newbie, just saying in general it's not a really used concept in java even though it exists)

Hey dude! Thank you for your help :) I successfully defined the server and the client proxy but here is the deal :

 

With an item I am sending a packet to server with int(1001)

When packet handler gets the int(1001) prints a "Done!"

 

It works on singleplayer still but doesnt work on the multiplayer :)

And I am okey with you saying me I am newbie! Because I am a newbie :D

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.