FastAsyncWorldEdit icon indicating copy to clipboard operation
FastAsyncWorldEdit copied to clipboard

fix: sponge v3 palette writer with __reserved__

Open PierreSchwang opened this issue 4 months ago • 4 comments

Overview

Fixes an issue where reserved was written into the block palette for sponge v3 schematics (example would be masked copies).

Submitter Checklist

  • [x] Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • [x] Ensure that the pull request title represents the desired changelog entry.
  • [x] New public fields and methods are annotated with @since TODO.
  • [x] I read and followed the contribution guidelines.

PierreSchwang avatar Aug 26 '25 22:08 PierreSchwang

What exactly is the fix? The change is a little abstract aha

dordsor21 avatar Oct 25 '25 08:10 dordsor21

Uhm, it was something related to an issue reported on discord. When saving a clipboard with some (maybe specific) mask, the writer would add a minecraft:reserved block state into the palette iirc.

I think this fix kinda streamlines it with the FastV2Writer? I'll have to look into it again lol. But this should write reserved as air for some reason (I guess because the state cache is setup that way or something)

PierreSchwang avatar Oct 25 '25 09:10 PierreSchwang

Ah, yeah: https://github.com/IntellectualSites/FastAsyncWorldEdit/blob/main/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicWriterV3.java#L144

I replace the ordinal in the resolver function if it's reserved, but don't use the ordinal to retrieve the string representation. I guess updating / replacing the actually BlockStateHolder could be cleaner?

PierreSchwang avatar Oct 25 '25 09:10 PierreSchwang

Yeah we shouldn't have __RESERVED__ going into schematics at all ideally

dordsor21 avatar Oct 26 '25 11:10 dordsor21