So I am creating a Capability for an ItemStack and have two major issues and a couple of questions:
The first issue is that the capabilities appear to sync fine, but the data flickers back to the default values on the client what appears to be randomly. On the server the values are always correct, however. I am thinking this is a serialization issue, but the serialization issue that I had in the past manifested itself differently to this (not being random).
I have checked the incoming packets used to sync the data, and they are correct.
The second issue is that I cannot figure out how to sync the item data for other players than the player who is holding the item. What is the best method for syncing this data to all players, regardless of whether the ItemStack is on the ground, in a container or being held by something?
Finally, I have a few questions regarding Capabilities and some other information:
First, the onUpdate for my Item is fairly simple and could be run on the client (at least partially). It only needs to be synced when the player picks up the ItemStack, drops it or opens a UI (all of which seem to also cause deserialization, so that would be the perfect time to sync). However, I cannot seem to figure out how to do this.
Secondly (not a Capabilities question, but doesn't seem worthy of a separate thread), are proxies still needed? I have references to client-only classes (such as a reference to Minecraft in the sync message) without the server exploding.