Add Items

This commit is contained in:
2025-07-08 17:50:06 +02:00
parent d0414c71f3
commit 50c24e68d0
2 changed files with 19 additions and 0 deletions
@@ -507,6 +507,15 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
BlockVector3 offset = BlockVector3.at(offsetX, offsetY, offsetZ);
origin = min.subtract(offset);
region = new CuboidRegion(min, min.add(width, height, length).subtract(BlockVector3.ONE));
} else if (metadataTag != null && metadataTag.containsKey("WorldEdit")){
CompoundTag weMeta = requireTag(metadataTag.getValue(), "WorldEdit", CompoundTag.class);
int[] off = requireTag(weMeta.getValue(), "Origin", IntArrayTag.class).getValue();
if (off.length != 3) {
throw new IOException("Invalid offset specified in schematic.");
}
origin = BlockVector3.at(off[0], off[1], off[2]);
region = new CuboidRegion(min.add(origin), min.add(origin).add(width, height, length).subtract(BlockVector3.ONE));
} else {
origin = min;
region = new CuboidRegion(origin, origin.add(width, height, length).subtract(BlockVector3.ONE));