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 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:
LinCompoundTagroot = LinRootEntry.readFrom(LinBinaryIO.read(in)).value();
LinCompoundTagschematic = root.getTag("Schematic", LinTagType.compoundTag());
LinCompoundTagmetadata = schematic.getTag("Metadata", LinTagType.compoundTag());
// and write to the final OutputStreamLinBinaryIO.write(newDataOutputStream(resultStream), newLinRootEntry("",
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).
The text was updated successfully, but these errors were encountered:
PierreSchwang
changed the title
[FEATURE] Modification of (nested) tags
Modification of (nested) tags
Oct 25, 2024
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).The text was updated successfully, but these errors were encountered: