-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Codecs to serializable classes #718
base: main
Are you sure you want to change the base?
Conversation
q: why do the singleton iotas (null/garbage) go through codec deserialization when they are Codec.unit's cant you just safely assume that the iota is just the unit |
Can you rebase this into fewer commits please? Like one commit for the codec implementation, and one commit where you switch everything over to using the new codecs. |
…asset download failures
…he square root of a negative number
…by defaulting all readable items to read NullIota() if no iota contained. Fixed behaviour of OpRead and similar if no IotaHolder found.
…umptionPriority.
…from things with nothing in them), remove references to Hands in places where they aren't needed.
…adding a writeable() method to IotaHolderItem.
…ackets unnecessarily, getting names of patterns for every cast and only using if a mishap occurs)
… enough for that to be fine.
… longer triggering.
….overcast.player" still needs to be defined in ru_ru and zh_cn.
Co-authored-by: [object Object] <[email protected]>
Co-authored-by: [object Object] <[email protected]>
…of hardcoding Control/Command in the book
I think we should probably delay this until after the 1.20.1 release. @object-Object I think you had similar thoughts? |
yeah, I have the project entry planned for "some future 0.11.x release" currently. I think we discussed it on Discord. |
adds codecs to serializable classes like Iotas, Continuation Frames, HexPattern, etc. Although codecs are not necessary for 1.20.1, this should help us migrate to future versions more easily.
Changes
All
serialize()
anddeserialize()
methods in classes with codecs have been marked as deprecated as they should be removed in future versions. The implementations of those methods have also been altered to use codecs.2 new extension functions have been added to
HexUtils.kt
to aid with using codecs:<T : Any> T.serializeWithCodec(codec: Codec<T>): Tag?
<T : Any> Tag.deserializeWithCodec(codec: Codec<T>): T?
All codecs were designed to be backwards compatible, so iotas from previous versions should load correctly.
Entity Iotas have been changed to accommodate codecs:
List<Iota>.getEntity
and related functions now require aworld
argument