Jump to content

GuiScreen and Item?


godbaba

Recommended Posts

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-

Link to comment
Share on other sites

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-

Link to comment
Share on other sites

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

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.