diff --git a/SchematicSystem/SchematicSystem_15/src/de/steamwar/schematicsystem/autocheck/AutoChecker15.java b/SchematicSystem/SchematicSystem_15/src/de/steamwar/schematicsystem/autocheck/AutoChecker15.java index a97cb133..387da8c5 100644 --- a/SchematicSystem/SchematicSystem_15/src/de/steamwar/schematicsystem/autocheck/AutoChecker15.java +++ b/SchematicSystem/SchematicSystem_15/src/de/steamwar/schematicsystem/autocheck/AutoChecker15.java @@ -20,6 +20,7 @@ package de.steamwar.schematicsystem.autocheck; import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.math.BlockVector3; @@ -96,6 +97,7 @@ public class AutoChecker15 implements AutoChecker.IAutoChecker { int counter = 0; for(CompoundTag item : items){ + System.out.println(item.getValue()); if(!item.containsKey("id")){ result.getDefunctNbt().add(pos); continue; @@ -112,6 +114,14 @@ public class AutoChecker15 implements AutoChecker.IAutoChecker { } if (item.containsKey("tag")) { result.getForbiddenNbt().computeIfAbsent(pos, blockVector3 -> new HashSet<>()).add(itemType); + } else if (item.containsKey("components")) { + if (item.getValue().get("components") instanceof CompoundTag) { + CompoundTag components = (CompoundTag) item.getValue().get("components"); + if (components.getValue().size() > 1) { + result.getForbiddenNbt().computeIfAbsent(pos, blockVector3 -> new HashSet<>()).add(itemType); + } else if (components.getValue().size() == 1){ + } + } } } result.getDispenserItems().put(pos, counter); diff --git a/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java b/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java index b682dad3..5748e23b 100644 --- a/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java +++ b/SpigotCore/SpigotCore_14/src/de/steamwar/core/WorldEditWrapper14.java @@ -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));