From 06cc2bb35ba0692e043cd618bdb3deb1bd781d52 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 24 Sep 2023 15:32:55 +0200 Subject: [PATCH] Fix testblock pasting Signed-off-by: yoyosource --- .../de/steamwar/bausystem/region/Region.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index dd234713..496b89f6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -445,22 +445,15 @@ public class Region { pasteBuilder.pastePoint(minPointBuild.add(prototype.getBuild().getSizeX() / 2, 0, prototype.getBuild().getSizeZ() / 2)); break; case TESTBLOCK: - Point pastePoint = minPointTestblock.add(prototype.getTestblock().getSizeX() / 2, 0, 0); - if (!pasteBuilder.getClipboardProvider().is(PasteBuilder.SchematicProvider.class)) { - pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2); - } else { - int dz = Math.abs(pasteBuilder.getClipboard().getOrigin().getZ() - pasteBuilder.getClipboard().getMinimumPoint().getZ()); - if (dz < 2 || dz > prototype.getTestblock().getSizeZ()) { - pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2); - } else if (pasteBuilder.getClipboard().getDimensions().getZ() != prototype.getTestblock().getSizeZ()) { - pastePoint = pastePoint.add(0, 0, pasteBuilder.getClipboard().getDimensions().getZ() / 2 - (pasteBuilder.getClipboard().getOrigin().getZ() - pasteBuilder.getClipboard().getMinimumPoint().getZ()) - 1); - } else { - pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2); - } + Point pastePoint = minPointTestblock.add(prototype.getTestblock().getSizeX() / 2, 0, prototype.getTestblock().getSizeZ() / 2); + if (pasteBuilder.getClipboardProvider().is(PasteBuilder.SchematicProvider.class)) { SchematicType schematicType = pasteBuilder.getClipboardProvider().as(PasteBuilder.SchematicProvider.class).getSchematic().getSchemtype(); if (schematicType.getKuerzel().equalsIgnoreCase("wg")) { pastePoint = pastePoint.add(0, 0, 1); } + if (schematicType.getKuerzel().equalsIgnoreCase("ws")) { + pastePoint = pastePoint.add(-1, 0, 0); + } } pasteBuilder.pastePoint(pastePoint); break;