#1335: Add API for in-world structures

By: coll1234567 <joshl5324@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2024-02-04 10:04:35 +11:00
parent f85f51fcf0
commit 49c217ec31
6 changed files with 148 additions and 5 deletions

View File

@@ -114,3 +114,16 @@
return nbttagcompound;
}
@@ -545,6 +563,12 @@
StructureStart structurestart = StructureStart.loadStaticStart(structurepieceserializationcontext, nbttagcompound1.getCompound(s), i);
if (structurestart != null) {
+ // CraftBukkit start - load persistent data for structure start
+ net.minecraft.nbt.NBTBase persistentBase = nbttagcompound1.getCompound(s).get("StructureBukkitValues");
+ if (persistentBase instanceof NBTTagCompound) {
+ structurestart.persistentDataContainer.putAll((NBTTagCompound) persistentBase);
+ }
+ // CraftBukkit end
map.put(structure, structurestart);
}
}