Hello, I have a storage class attached to the chunks in the world, all values do work and sync correctly, except one boolean, which always for whatever reason seems to default to false, even when constructively set to true. I send a packet to sync all the data from the server to the client, however, as stated, this value always defaults to false. The client actually handles this value well (as in set to true when I want it too), but the way I'm accessing it must be done through the server side, so I need these values to be synced. I just cannot understand why the server is insisting on this value being false when there is no way for it to be set to false (other than the default value of a boolean). I've spent hours trying to debug and see where things are going wrong: during packet sending, in the event itself, etc. One possible pointer is when I call this function through both client and server, it does work, as the client value is what is true which executes the task I want.
Here is where I'm setting this boolean:
type.hasPossibleNaturalNode does properly set this variable, it can be replaced with true and the same issue still exists.
[all of these classes are viewable in my github (see signature), as well as the gradlew scripts for decompilation]
Here is the VoidStorage class, which is stored to the chunks [located in capability/voidchunk/VoidStorage] [interface can be found in api/capablity/voidchunk/IVoidChunk]:
Here is the Capability Class [CapabilityVoidChunk located in capability/voidchunk/CapabilityVoidChunk]:
And here is the event class [CommonEvents, located in events/CommonEvents]:
Lastly the packet class [PacketVoidChunk located in network/packets/PacketVoidChunk]:
Here are a few more pointers:
- I know the issue is some kind of desync between the server and client during the creation of the Capability, I just can't figure out what.
- When I go to send the packet, I'm often left with results that look like:
Sending hasNaturalNodePacket, currently set before packet: true \ setting to(packet is carrying): false
- Without sending the packet, I'm usually left with:
Server Side Response: hasNaturalNode: false \ Client Side Response: hasNaturalNode: true
- This value is used in VoidChunk#onChunkLoad, where I set a block at specific block coordinates, depending on hasNaturalNode.
- As all values are being synced between the server TO the client (ex. the integer voidValue, or the integer voidTypeID), why would this one act like this need to be synced from the client TO the server?
Thank you and sorry for the spew of text.