Hi, I learnt how to create and use Packets for Forge, however I am struggling with Modloader version of packet sending.
Basically this is what I want. My server keeps track if its day or night, then adjusts variables. This works 100%, however I can't update my clients variables with my servers variables.
Here is the code I am using for my server side, atm I am just trying to get an static int sayhi to update on the client. After that works I will have my static boolean variables, phantomClock and ServerOn in the packet.
So with this code, during the day my sayhi system.outs 0, and 1 at night. However my client still only spams 0.
At the way bottom of my server mod_, I have this method before closing my class. Hoping this would Update my client =/ however I don't think its working from the stand point sayhi still spams 0 on my client cmd prompt.
public void HandlePacket(Packet230ModLoader packet, EntityPlayerMP player)
{
switch(packet.packetType)
{
case 0:
{
sayhi = packet.dataInt[0];
}
}
}
I also included this code at the same place in my client mod_
public void HandlePacket(Packet230ModLoader packet)
{
switch(packet.packetType)
{
case 0:
{
sayhi = packet.dataInt[0];
}
}
}
Still no luck. Any help will be most welcomed. Thanks for in advance
Basically this is what I want. My server keeps track if its day or night, then adjusts variables. This works 100%, however I can't update my clients variables with my servers variables.
Here is the code I am using for my server side, atm I am just trying to get an static int sayhi to update on the client. After that works I will have my static boolean variables, phantomClock and ServerOn in the packet.
So with this code, during the day my sayhi system.outs 0, and 1 at night. However my client still only spams 0.
At the way bottom of my server mod_, I have this method before closing my class. Hoping this would Update my client =/ however I don't think its working from the stand point sayhi still spams 0 on my client cmd prompt.
I also included this code at the same place in my client mod_
Still no luck. Any help will be most welcomed. Thanks for in advance
-Jade.