[SPIGOT-6790] Structure saving STRUCTURE_VOID Created: 05/Nov/21  Updated: 11/Nov/21  Resolved: 11/Nov/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Shane Bee Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Attachments: File TestPlugin-1.0-SNAPSHOT.jar    
Version: CraftBukkit version 3276-Spigot-3892929-b58f429
Plugin: just my test plugin
Guidelines Read: Yes

 Description   

I noticed when saving structures using the new API, structure_void blocks are saving to the palette, this isn't something that vanilla Minecraft does.

this is the NBT of a structure saved with Spigot:

 

[14:00:22 INFO]: SPIGOT: {
 size: [2, 2, 2],
 DataVersion: 2730,
 blocks: [
  {
   state: 0,
   pos: [0, 0, 0]
  },
  {
   state: 1,
   pos: [0, 0, 1]
  },
  {
   state: 1,
   pos: [1, 0, 0]
  },
  {
   state: 1,
   pos: [1, 0, 1]
  },
  {
   state: 2,
   pos: [0, 1, 0]
  },
  {
   state: 1,
   pos: [0, 1, 1]
  },
  {
   state: 1,
   pos: [1, 1, 0]
  },
  {
   state: 3,
   pos: [1, 1, 1]
  }
 ],
 palette: [
  {
   Name: "minecraft:stone"
  },
  {
   Name: "minecraft:bedrock"
  },
  {
   Name: "minecraft:iron_ore"
  },
  {
   Name: "minecraft:structure_void"
  }
 ],
 entities: []
} 

 

 

this is the NBT of a structure saved with MC (using a vanilla structure block)

 

14:00:22 INFO]: MC: {
 size: [2, 2, 2],
 DataVersion: 2730,
 blocks: [
  {
   state: 0,
   pos: [0, 0, 0]
  },
  {
   state: 1,
   pos: [0, 0, 1]
  },
  {
   state: 1,
   pos: [1, 0, 0]
  },
  {
   state: 1,
   pos: [1, 0, 1]
  },
  {
   state: 1,
   pos: [0, 1, 0]
  },
  {
   state: 1,
   pos: [0, 1, 1]
  },
  {
   state: 1,
   pos: [1, 1, 0]
  }
 ],
 palette: [
  {
   Name: "minecraft:stone"
  },
  {
   Name: "minecraft:bedrock"
  }
 ],
 

in both, I placed down a structure_void, as you can see, Minecraft does not save this to file.

 

The reason behind that is, Minecraft saves air (same as spigot), and places air, but structure voids are void from the world, and do not replace blocks where they are placed.

Spigot not following suit with this kinda breaks the logic. Maybe an option is to add a method or something to remove all structure voids and/or dont save them to file.

I will include a test plugin, which creates a spigot structure, saves it to file, then prints out the palette. Unfortunately the NBT I got externally.

 

Steps to reproduce:

  • install my plugin on the server
  • run command `/test` in console
  • this will create a structure named "test-spigot" in `world/generated/minecraft/structures/`
  • it will also print out the palette in console, showing that the structure void was saved, when it shouldn't be saved to the palette

 



 Comments   
Comment by Shane Bee [ 05/Nov/21 ]

doing some digging, referencing this line:

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/structure/CraftStructure.java#90

The last param is the block that should be ignored (not saved), ie: STRUCTURE_VOID, which in this case was nullified. 

Generated at Sat Dec 13 15:25:44 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.