Some syntax-sugar for modifying LinCompoundTags (especially nested in deeper compounds) would be a great addition.
An example would be: After writing a schematic using the WorldEdit SpongeV3 writer I want to add more metdata to the schematic, where the current approach would be something like:
LinCompoundTag root = LinRootEntry.readFrom(LinBinaryIO.read(in)).value();
LinCompoundTag schematic = root.getTag("Schematic", LinTagType.compoundTag());
LinCompoundTag metadata = schematic.getTag("Metadata", LinTagType.compoundTag());
// and write to the final OutputStream
LinBinaryIO.write(new DataOutputStream(resultStream), new LinRootEntry("",
root.toBuilder()
.put("Schematic", schematic.toBuilder()
.put("Metadata", metadata.toBuilder()
.putByte("MyCustomStuff", (byte) 1).build()
).build()
).build()
));
A simpler (and more readable) approach would be a helper method like editTag(name, type, lambda) (Discord).
Some syntax-sugar for modifying LinCompoundTags (especially nested in deeper compounds) would be a great addition.
An example would be: After writing a schematic using the WorldEdit SpongeV3 writer I want to add more metdata to the schematic, where the current approach would be something like:
A simpler (and more readable) approach would be a helper method like
editTag(name, type, lambda)(Discord).