Hey all, Question for you:
I have a TileEntity that does some relatively heavy calculations and stores some data, fortunately it does this only once every 10 seconds. The client has no need of the data except when the Block's GUI is open. So I have only the server running the calculations. After much confusion, I had the "ah ha" moment that the client's TileEntity needs to be updated, from the server. There seems to be a few ways to do this:
1. Use the getDescriptionPacket (Packet132) method in the TileEntity. From what I read, this will update players in the vicinity on some periodic basis. My concern, this is a lot of extra traffic if people never open the GUI (which they prob. wont most of the time), and I'm not totally sure what the interval is, so I don't know if its fast enough to keep the GUI in sync with the TileEntity.
2. Send a custom packet (Packet250) from the server when the server executes the openGui(). This avoid unnecessary traffic, but causes a bit of a visible delay, as the GUI appears, then the packet is received, then the GUI is updated.
My question is two parts a) Is the TileEntity the right place for this kind of work, looking at source of other mods seems to suggest the Tile is the "workhorse" for your blocks b) Am I being overly concerned about traffic and should just go with #1 for the better GUI experience, or does the packet system incur a lot of overhead and should be used as sparingly as possible.
Thanks
-pete