SteamWar/BauSystem
Archiviert
13
0

RegionFix #222

Manuell gemergt
YoyoNow hat 9 Commits von RegionFix nach master 2021-04-03 11:55:02 +02:00 zusammengeführt
Nur Änderungen aus Commit 2131cc9423 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -54,27 +54,6 @@ class Region_15 {
}
static EditSession paste(Clipboard clipboard, int x, int y, int z, boolean rotate) {
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
ClipboardHolder ch = new ClipboardHolder(clipboard);
BlockVector3 dimensions = clipboard.getDimensions();
BlockVector3 v = BlockVector3.at(x, y, z);
BlockVector3 offset = clipboard.getRegion().getMinimumPoint().subtract(clipboard.getOrigin());
System.out.println("min point cb: " + clipboard.getMinimumPoint());
System.out.println("min point rg: " + clipboard.getRegion().getMinimumPoint());
System.out.println("origin: " + clipboard.getOrigin());
if (rotate) {
ch.setTransform(new AffineTransform().rotateY(180));
v = v.add(dimensions.getX() / 2 + dimensions.getX() % 2, 0, dimensions.getZ() / 2 + dimensions.getZ() % 2).subtract(offset.multiply(-1, 1, -1)).subtract(1, 0, 1);
} else {
v = v.subtract(dimensions.getX() / 2 - dimensions.getX() % 2, 0, dimensions.getZ() / 2 - dimensions.getZ() % 2).subtract(offset);
}
Operations.completeBlindly(ch.createPaste(e).to(v).build());
return e;
}
}
static EditSession pasteNew(Clipboard clipboard, int x, int y, int z, boolean rotate) {
try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) {
ClipboardHolder ch = new ClipboardHolder(clipboard);
BlockVector3 dimensions = clipboard.getDimensions();