FastAsyncWorldEdit icon indicating copy to clipboard operation
FastAsyncWorldEdit copied to clipboard

Return air instead of __reserved__ when reading non-cuboid clipboard

Open SirYwell opened this issue 11 months ago • 5 comments

Overview

Fixes #3065

Description

Returning the __reserved__ block state results in clipboards containing that block state, means they can't be loaded by other tools correctly and FAWE won't place air correctly.

### 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](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md).

SirYwell avatar Jan 09 '25 15:01 SirYwell

Can we potentially add a flag somewhere for allowing the reserved? If we set a clipboard within FAWE it might be wanted not to set outside the original copy region, but still set air within. Presumably this is also an issue for the other FAWE implementations as well?

dordsor21 avatar Jan 10 '25 13:01 dordsor21

Can we potentially add a flag somewhere for allowing the reserved? If we set a clipboard within FAWE it might be wanted not to set outside the original copy region, but still set air within.

This just mirrors the behavior of WE. Manually checking if the point is in the region when needed sounds more appropriate.

Presumably this is also an issue for the other FAWE implementations as well?

It seems like WorldCopyClipboard will just return the actual blocks outside of its region, so that's wrong in a different way. The memory clipboard seems to work correctly from a quick test, not sure why though.

SirYwell avatar Jan 11 '25 08:01 SirYwell

Can we potentially add a flag somewhere for allowing the reserved? If we set a clipboard within FAWE it might be wanted not to set outside the original copy region, but still set air within.

This just mirrors the behavior of WE. Manually checking if the point is in the region when needed sounds more appropriate.

We won't necessarily have the selection when pasting - it could have changed between the copy and paste, or have been made before a restart

Presumably this is also an issue for the other FAWE implementations as well?

It seems like WorldCopyClipboard will just return the actual blocks outside of its region, so that's wrong in a different way. The memory clipboard seems to work correctly from a quick test, not sure why though.

memory optimized doesn't "store" air so I believe would assume reserved is just normal air. CPU optimized is potentially problematic as it'd read a char of 0 from the array

dordsor21 avatar Jan 11 '25 10:01 dordsor21

We won't necessarily have the selection when pasting - it could have changed between the copy and paste, or have been made before a restart

Hm, that's an interesting scenario. I guess SimpleRegion always returning a CuboidRegion is wrong then in first place, and we need to somehow improve on that?

SirYwell avatar Jan 11 '25 15:01 SirYwell

Hm, that's an interesting scenario. I guess SimpleRegion always returning a CuboidRegion is wrong then in first place, and we need to somehow improve on that?

Yeah potentially some more thought to that. I do think it's a feature to allow "non-rectangular" clipboards to have air without overwriting a selection

dordsor21 avatar Jan 18 '25 17:01 dordsor21