1 Commits

Author SHA1 Message Date
50c24e68d0 Add Items
All checks were successful
SteamWarCI Build successful
2025-07-08 17:50:06 +02:00
2 changed files with 19 additions and 0 deletions

View File

@ -20,6 +20,7 @@
package de.steamwar.schematicsystem.autocheck; package de.steamwar.schematicsystem.autocheck;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
@ -96,6 +97,7 @@ public class AutoChecker15 implements AutoChecker.IAutoChecker {
int counter = 0; int counter = 0;
for(CompoundTag item : items){ for(CompoundTag item : items){
System.out.println(item.getValue());
if(!item.containsKey("id")){ if(!item.containsKey("id")){
result.getDefunctNbt().add(pos); result.getDefunctNbt().add(pos);
continue; continue;
@ -112,6 +114,14 @@ public class AutoChecker15 implements AutoChecker.IAutoChecker {
} }
if (item.containsKey("tag")) { if (item.containsKey("tag")) {
result.getForbiddenNbt().computeIfAbsent(pos, blockVector3 -> new HashSet<>()).add(itemType); 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); result.getDispenserItems().put(pos, counter);

View File

@ -507,6 +507,15 @@ public class WorldEditWrapper14 implements WorldEditWrapper {
BlockVector3 offset = BlockVector3.at(offsetX, offsetY, offsetZ); BlockVector3 offset = BlockVector3.at(offsetX, offsetY, offsetZ);
origin = min.subtract(offset); origin = min.subtract(offset);
region = new CuboidRegion(min, min.add(width, height, length).subtract(BlockVector3.ONE)); 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 { } else {
origin = min; origin = min;
region = new CuboidRegion(origin, origin.add(width, height, length).subtract(BlockVector3.ONE)); region = new CuboidRegion(origin, origin.add(width, height, length).subtract(BlockVector3.ONE));