Jump to content

[1.8] FMLCommonHandler SSP vs SMP


deenkayros

Recommended Posts

Hello,

 

Running MC(+Forge 1303) both in SSP and SMP I noticed that FMLCommonHandler has different behaviors:

 

In SSP the FMLCommonHandler fire the events (eg. PlayerTickEvent) in both sides (SERVER and CLIENT)

 

Instead in SMP the FMLCommonHandler fire only SERVER side events then I can't set nothing regarding CLIENT properties (eg. gameSettings)

 

How can set CLIENT properties from SERVER side OR forcing FMLCommonHandler to fire CLIENT events too?

 

Hoping I've been clear, I thank you in advance.

 

Link to comment
Share on other sites

If you are talking about SMP = dedicated server then:

 

Client is built of Client thread and Integrated Server thread if you are running on SSP.

If you connect to SMP (dedicated) your client will only have Client thread running and dedicated server will take role of Server thread.

 

To change values on sides you need to implement communication - packets.

 

Also: YOU SHOULD NEVER, EVER change stuff directly (only with packets) in one thread using other thread (even in SSP).

 

Tutorials:

http://www.minecraftforge.net/forum/index.php/topic,20135.0.html

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2137055-1-7-x-1-8-customizing-packet-handling-with

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Well, of course the dedicated server cannot fire client events or modify client data directly. It's running on a different machine, potentially on the other side of the planet.

You need to send packets if you want the client to do something.

 

Ok, but how works the packets? I mean I always sent packets from CLIENT to SERVER, in this case it should be the reverse ie from SERVER to CLIENT, and my question is which CLIENT? because there could be many.

Link to comment
Share on other sites

Well, yes. You send the packet to one EntityPlayerMP. Which one you need to send it to depends on what you are trying to do.

 

Thank you and thanks to Ernio for the tutorial links!!!!

 

But my very last question regarding the particles, and as you know they are client side only, now if I need to show some particles generated from an EntityPlayerMP I'll need to send a packet from server to that EntityPlayerMP BUT the particles will be shown to others Players too?

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.