Posted February 7, 201510 yr 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.
February 7, 201510 yr 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.
February 7, 201510 yr Author 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.
February 7, 201510 yr Author 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?
February 7, 201510 yr Author No, you would have to send the packet to every player you want the particles to display. sendToAll is correct?
February 7, 201510 yr Author No, that would send it to all players that are on the server. You only want to send it to players who are nearby and therefor can see the particles. ok, sendToAllAround right?
February 7, 201510 yr Author Yes. the sendToAllAround needs "TargetPoint" but I cant find it. How can I get the target point from a PlayerEntity? EDIT: Ok found, but the "range" is the blocks distance?
February 7, 201510 yr Author TargetPoint needs dimension, x, y, z and radius. You get the first 4 from any entity: entity.dimension entity.posX entity.posY entity.posZ The radius you have to decide yourself. the radius is the blocks distance?
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.