Posted June 17, 201312 yr Okay so I just got into modding, I have quite a bit experience with Java as I've created a java game as the project before this one, anyways my problem is that i have one TileEntity on the server and one on the Client, the problem is that they don't sync there variables So my problem is that I do get power into both entities, although one is drained bu the client gui still think it have power as it gets the client entity instread of the server entity :'( I've been googling around for quite a time now and haven't found any solution to this so I hope i can get some here! The TileEntity: https://github.com/vpklotar/Industrial-Line/blob/master/src/se/vpklotar/li/block/furnace/FurnaceEntity.java The block: https://github.com/vpklotar/Industrial-Line/blob/master/src/se/vpklotar/li/block/furnace/Mk1Furnace.java Main file: https://github.com/vpklotar/Industrial-Line/blob/master/src/se/vpklotar/il/Il.java
June 17, 201312 yr there are methods called getDatapacket and onDataPacketrecived in the TileEntity. These get passed from the server to the client every time the block is marked for an update (via world.markBlockForUpdate). You can write the NBT for the server tile to the packet sent form this, then read it on the client. That's how i do it for one of my tile entities, Not quite as complex as yours but it should still apply. github
June 17, 201312 yr Sync with packets, using the classes in the FML.packet (or something like that, look for PacketDispatcher) and the getDescriptionPacket() in TileEntity. Don't use too many packets, you'll bog down the server, client, and everything else on your computer. So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.
June 18, 201312 yr Author Okay, so ill try the getDataPacket() and see what i can get, i tried with the packets but i didn't get them to sync? Anyway, I'll try that out and reply if I can't get it to work, otherwise a "Thank You" will get thrown out
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.