Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure Voids are replaced with a placeholder (in structure schem) #3090

Open
2 tasks done
lafless opened this issue Jan 26, 2025 · 3 comments · May be fixed by #3092
Open
2 tasks done

Structure Voids are replaced with a placeholder (in structure schem) #3090

lafless opened this issue Jan 26, 2025 · 3 comments · May be fixed by #3092
Labels
Approved Added if an issue has been approved by a maintainer Bug Something isn't working

Comments

@lafless
Copy link

lafless commented Jan 26, 2025

Server Implementation

Paper

Server Version

1.21.3

Describe the bug

When saving my clipboard as an nbt structure, FAWE seems to replace structure void blocks with a random block relating to the structure, but only if the structure blocks cover an entire layer's air blocks.

To Reproduce

  1. Build a small hut / structure with open interior
  2. Select the hut and fill all air blocks with structure void
  3. Remove all structure void that remain inside the structure
  4. Copy the selection
  5. Save the selection as an nbt structure schematic
  6. Load the schematic
  7. Paste

Expected behaviour

The expected behavior would be for the structure void to be pasted with OR removed (based on how Minecraft's jigsaw structure saving works - I'm not 100% aware of the block placement result, but I am aware that it should either place structure voids, or nothing - definitely not a random block)

Screenshots / Videos

Example Build
Image

Structure NBT save (after replacing blocks at the door holes and below with structure void)
Image

Loading, and pasting the saved structure schematic.

Image

Error log (if applicable)

No response

Fawe Debugpaste

https://athion.net/ISPaster/paste/view/aefc6b24ad0b49a3b3767963f8e635cc

Fawe Version

2.12.4-SNAPSHOT-1025;63f7871

Checklist

Anything else?

Thanks for taking a look! I hope this gets fixed in a somewhat timely manner if this is indeed a bug and not a misuse on my end.

@lafless lafless added the Requires Testing This is a new issue which needs to be approved before labeled with "bug" label Jan 26, 2025
@lafless
Copy link
Author

lafless commented Jan 26, 2025

As I just realized my snapshot version was 3 sub versions behind the most recent (1028), I ran the test again with the newest release and found the same results.

Image

Edit: This bug also exists on 1.21.4 (tested)

@boyonk913
Copy link

This is caused by

if (block.getBlockType() == BlockTypes.STRUCTURE_VOID || ordinals.containsKey(block.getOrdinalChar())) {

The code iterates over the clipboard twice: once to assemble the palette and the second time to store the blocks as references to the palette. The problem arises because structure voids are avoided being added to the palette, but the second loop still tries to store the structure void as references to the palette, causing it to be mismatched to a different block in the palette.

Depending on what the intended/desired behaviour is, the fix would be to either save structure voids to the palette, or to also skip structure voids in the second loop.

@PierreSchwang
Copy link
Member

This is caused by

FastAsyncWorldEdit/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/schematic/MinecraftStructure.java

Line 207 in d73ff19
if (block.getBlockType() == BlockTypes.STRUCTURE_VOID || ordinals.containsKey(block.getOrdinalChar())) {

The code iterates over the clipboard twice: once to assemble the palette and the second time to store the blocks as references to the palette. The problem arises because structure voids are avoided being added to the palette, but the second loop still tries to store the structure void as references to the palette, causing it to be mismatched to a different block in the palette.

Depending on what the intended/desired behaviour is, the fix would be to either save structure voids to the palette, or to also skip structure voids in the second loop.

Yeah, seems like i missed

- thank you

@PierreSchwang PierreSchwang added Bug Something isn't working Approved Added if an issue has been approved by a maintainer and removed Requires Testing This is a new issue which needs to be approved before labeled with "bug" labels Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Added if an issue has been approved by a maintainer Bug Something isn't working
Projects
None yet
3 participants