Conversation
41b70f2 to
ccca50f
Compare
Originally the GPL 3.0 license was decided on so that any improvements or derivative projects that benefit from this project would also have to their source be shared and open. However, GPL imposes itself even if this library is only being used as a dependency. LGPL would've been more in line with the original intent for the license, since it more so applies to modification of the project/binaries, and doesn't impose itself on other projects when used as a dependency. (cherry picked from commit 0d5cf0b)
Both use Node 16, and had warnings about it being deprecated. (cherry picked from commit 17412e3)
(cherry picked from commit 7869eaf)
(cherry picked from commit 6f73e0c)
The new GitHub macOS host uses ARM, and the Adopt/Temurin JDKs no longer work since they aren't built for that architecture until Java 11. See: actions/setup-java#625 (cherry picked from commit 6580e06)
84865c8 to
4d49885
Compare
It has been a frequent cause of issues while rebasing by frequently changed without adding anything of substance, and hasn't been contributing any value to the project.
f2b06bb to
1119e71
Compare
ac18958 to
7050a30
Compare
7050a30 to
8024160
Compare
8024160 to
22370b3
Compare
a066834 to
9caf9f7
Compare
Element was accurate when copying from `JsonTransformingSerializer`, since it worked with `JsonElement`s, but should've been changed when adapting the serializer to NBT.
There were design issues around providing an `NbtFormat` instance as the default since not all the formats *can* have a default instance. Previously this was worked around by having an illegal instance with values that would be explicitly ignored by the builder using a reference check. The previous approach feels like a code smell, treating an incompletely configured instance as if it were complete when passing it as a default, while requiring special treatment for the "default" instance since it isn't a behavioral subtype semantically. With more specific `NbtFormat` subtypes coming later on, this new approach with objects that provide the defaults should be more wieldy to implement and maintain. The `Default` implementations that required special handling have been removed, and there is now a single source of truth for each option's default value.
Will be split into different implementations for each NBT variant, since each will have slightly different APIs e.g. with Java requiring a named NbtCompound at the root, JavaNetwork supporting unnamed nullable tags at the root, etc.
TODO: Nbt docs
Nbt from any NbtFormat
Nbt from any NbtFormat
Does not have any affect currently, but safeguards against format changes being introduced in the future.
When testing JavaNetwork serialization against Java, all tag types were used even though Java only supports NbtCompound tags at the root.
TODO Uncommitted changes
Moved `NbtTagType` out of the internal package, and exposed it and `NbtTag.type` ...
08366e1 to
23f1ef4
Compare
Moved `NbtTagType` out of the internal package renaming it to `NbtType`, and exposed it and `NbtTag.type` ...
Renamed `NbtTagTypeTest.kt` to `NbtTypeTest.kt`, as a separate commit so its history is preserved.
23f1ef4 to
816bfa1
Compare
|
Hey, any update ? |
Sorry for the late reply! I'm recently in between jobs, so I have some more free time and this is one of the things I want to try to wrap up and put a nice bow on to finally get these changes out there. Last time I was working on it I kept running into issues representing the tag types in the That, and I also want to put out a more straightforward PR that will make introspecting serial descriptors much better, since especially with NBT and the need to encode the tag type ahead of time, not being able to introspect descriptors as well as I'd like means I have to jump through some hoops, e.g. defer encoding until a serializer begins encoding a value or some child elements (with TAG_End or TAG_List/arrays), and I lose out on validation and consistency checks because of that. If that makes sense! I do think I can get a "good enough" implementation without that in the meantime though. After opening the KXS issue and after the PR, you should start seeing new commits here while I've got the free time during my job search :) |
Oh I didn't know that, sorry to rush you, I hope you'll have a stable situation soon! |
See #29
Tasks:
NbtFormatBuilderinterfaceparameterizedNbtFormat()testing functionlistOf(NbtList, NbtByteArray)is inferred asList<Any>instead ofList<NbtTag>Nbt*Arrays withLists, and encode arrays asNbtListby default, and require@NbtArray#34, fixing the problem with elements whose serializers delegate toByte/Int/LongArrays (see here)serializeris an instance of*ArraySerializer@NbtNamedto@NbtName, retaining the existing NBT names on test classes that have themNbtNamed<T>class next, that way the later changes have something to migrate to when moving away from the single-entry-root-compound name representationNbtNamed<NbtTag>to match those onNbtTag, so that dealing with named tags is more seamless when the name is unimportant. E.g.namedTag.nbtIntencodeTo/decodeFromNamedNbtTag()functions, so tests have a way to check against the serialized representationNbtName.Dynamicthat disables root name validation for a type (and later allows name to be serialized dynamically with encoder/decoder functions)@NbtName.Dynamicwhen delegating to another dynamic serializerDynamicwill be considered to have anNbtName(""by default). As opposed to requiring@NbtNameor not being named until the name is dynamically encoded, since all types will eventually be implicitly NbtNamed anyway)@NbtNamework on any serializable typeNbtNamedclass serializable. Done after implementing it as an encode/decode representation because those will be necessary for testing its serializationbuildNbtCompound(name)andbuildNbtList(name)functions to returnNbtNamed@NbtNameto only nest under the name for the root value@NbtNamedocs, which says it instructs the serialization to nest within an NBT compound so it's namedJavaNetworkdocs: "Serializes unnamed NbtTags for use in network packets"@NbtNamelenientNbtNameconfiguration option, and name validationJavaNbt,JavaNetworkNbt(val protocolVersion), etc.)Nbtclass. Requiring that they all have the sameencodeToNbtTag()is forcing an abstraction. In reality, they are all (slightly) different formats, so should each be its ownNbtFormatimplementation (with all the same binary serialization methods, but different in-memoryNbtTagserialization methods)NbtFormatprovidingencodeTo/decodeFromNbtTagwith all NBT capabilities (named root, nullable root, special floating point values, etc) that fully captures how a class would serialize to NBT, not just how a specific limited variant would be serialized. This is useful for testing/experimenting by library users, but also necessary forNbtTransformingSerializerso serializer's using it aren't unnecessarily limited by a specific NBT format.discardTag()might need to accept TAG_EndNbtTag?.convenience properties, maybe including.nbtTagand.nbtEndCompositeNbtEncoder/Decoder?decodeElementNbtTagType()later could have slightly different semantics between the base decoder and the composite decoder, and may be better as a separate element-specific function.NbtTagTypeNbtTag.typepublic (the member property and the extension property)decodeNbtTagType()function toNbtDecoder(and changedecodeNotNullMark()to use it)@NbtNameentirely?encode/decodeNbtNameare straightforward to use, and its validation functionality mixed with@NbtName.Dynamicadds complexity when that could be left entirely to a simpleKSerializerimplementation (especially now that@KeepGeneratedSerializeris a thing, letting you tack an extra line of NBT name code onto the generated serialization process)