You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some API to simplify data synchronization, not breaking changes.
Goals
Simplify Data(additional) Synchronization for Entity
Simplify Data(additional) Synchronization for TileEntity
Simplify Data Synchronization for Capabilities
//TODO : more
Non Goals
Breaking changes of network.
Motivation
The existing methods are not good enough or cannot be used, so we have to reinvent the wheel and implement it into IMessage.
Description
Simplify Data(additional) Synchronization for Entity
Custom DataParameter
DataParameter is a very easy-to-use tool for synchronizing front-end and back-end entity data. However, it may not be suitable for transmitting additional information at this time. On the one hand, if you use EntityDataManager#createKey, it will automatically assign numerical IDs in the order of registration. It is difficult to control the registration order by writing outside the target entity class, and hacking into the target <clinit> cannot control the order with other mods. There is no guarantee that the ID will be consistent between the front and back ends. On the other hand, calling DataParameter#<init> directly can specify a numeric id, but there is no guarantee that it will not conflict. The vanilla DataParameter is statically initialized using createKey in the target class. I hope modders can attach the DataParameter they want to these entities, automatically arrange the IDs under the cleanroom schedule and keep the front and back ends consistent.
I imagined an event: the modder provides a ResourceLocation to the event as a registration name to register its own DataParameter. The cleaning room sorts them in alphabetical order and assigns ids. Comparing the front and back ends requires that all attached DataParameters are consistent. The event uses the transformer hook and is triggered at the end of the <clinit> of the entity class.
Rongmario
I think we can create generic networking, similar to packet+dataparameter.
It can be a simple submitting of value, or a more complex program.
Simplify Data(additional) Synchronization for TileEntity
Simplify Data Synchronization for Capabilit
Dependencies
No response
References
No response
Guidelines
I have and will continue to adhere to the guidelines
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Some API to simplify data synchronization, not breaking changes.
Goals
//TODO : more
Non Goals
Breaking changes of network.
Motivation
The existing methods are not good enough or cannot be used, so we have to reinvent the wheel and implement it into
IMessage
.Description
DataParameter
Dependencies
No response
References
No response
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions