From 55a63dacaf6b596dc1ae1b3cd8f525d512044c6c Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 6 Feb 2023 21:38:12 +0100 Subject: [PATCH] es kann sein das da was fehlt, da ich mit den commits durcheinander gekommen bin --- .../bausystem/utils/FlatteningWrapper15.java | 10 ++++++-- .../features/region/TestblockCommand.java | 4 ++-- .../bausystem/region/PasteOptions.java | 24 ------------------- .../de/steamwar/bausystem/region/Region.java | 16 ++++++------- 4 files changed, 18 insertions(+), 36 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java index fb02039e..c64ae034 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java @@ -19,6 +19,8 @@ package de.steamwar.bausystem.utils; +import com.google.common.collect.ImmutableMap; +import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; @@ -42,8 +44,9 @@ import com.sk89q.worldedit.regions.selector.CuboidRegionSelector; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.region.Color; import de.steamwar.bausystem.region.PasteOptions; import de.steamwar.bausystem.region.Point; @@ -61,7 +64,10 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.util.*; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; import java.util.logging.Level; public class FlatteningWrapper15 implements FlatteningWrapper { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index 2db16400..a677e4df 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -57,7 +57,7 @@ public class TestblockCommand extends SWCommand { Region region = regionCheck(p); if (region == null) return; try { - region.reset(RegionType.TESTBLOCK, regionExtensionType, true); + region.reset(RegionType.TESTBLOCK, regionExtensionType); RegionUtils.message(region, "REGION_TB_DONE"); } catch (IOException e) { BauSystem.MESSAGE.send("REGION_TB_ERROR", p); @@ -86,7 +86,7 @@ public class TestblockCommand extends SWCommand { } try { - region.reset(node, RegionType.TESTBLOCK, regionExtensionType, true); + region.reset(node, RegionType.TESTBLOCK, regionExtensionType); RegionUtils.message(region, "REGION_TB_DONE"); } catch (IOException e) { BauSystem.MESSAGE.send("REGION_TB_ERROR", p); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java b/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java index c782a06b..fe64f44c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java @@ -28,44 +28,20 @@ import lombok.Getter; @AllArgsConstructor public class PasteOptions { - /** - * Used in 1.15 - */ private final boolean rotate; - /** - * Used in 1.15 - */ private final boolean ignoreAir; - /** - * Used in 1.15 - */ private final Color color; - /** - * Used in 1.15 - */ private final boolean onlyColors; - /** - * Used in 1.15 - */ private final boolean reset; - /** - * Used in 1.15 - */ private final Point minPoint; - /** - * Used in 1.15 - */ private final Point maxPoint; - /** - * Used in 1.15 - */ private final int waterLevel; private final boolean testBlock; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index e2787034..2f79be02 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -421,12 +421,12 @@ public class Region { reset(schematic, regionType, RegionExtensionType.NORMAL, false); } - public void reset(RegionType regionType, RegionExtensionType regionExtensionType, boolean isTestBlock) throws IOException { - reset(null, regionType, regionExtensionType, isTestBlock); + public void reset(RegionType regionType, RegionExtensionType regionExtensionType) throws IOException { + reset(null, regionType, regionExtensionType); } - public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean isTestBlock) throws IOException { - reset(schematic, regionType, regionExtensionType, false, isTestBlock); + public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType) throws IOException { + reset(schematic, regionType, regionExtensionType, false); } public void reset(File file) { @@ -435,11 +435,11 @@ public class Region { undoSessions.push(editSession); } - public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean isTestBlock) throws IOException { - reset(schematic, regionType, regionExtensionType, ignoreAir, false, isTestBlock); + public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir) throws IOException { + reset(schematic, regionType, regionExtensionType, ignoreAir, false); } - public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors, boolean isTestBlock) throws IOException { + public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors) throws IOException { if (!hasReset(regionType)) { return; } @@ -447,7 +447,7 @@ public class Region { regionExtensionType = RegionExtensionType.NORMAL; } - PasteOptions pasteOptions = new PasteOptions((schematic != null && (schematic.getSchemtype().fightType() || schematic.getSchemtype().check())), ignoreAir, getPlain(Flag.COLOR, ColorMode.class).getColor(), onlyColors, regionExtensionType == RegionExtensionType.EXTENSION, getMinPoint(regionType, regionExtensionType), getMaxPoint(regionType, regionExtensionType), waterLevel, isTestBlock); + PasteOptions pasteOptions = new PasteOptions((schematic != null && (schematic.getSchemtype().fightType() || schematic.getSchemtype().check())), ignoreAir, getPlain(Flag.COLOR, ColorMode.class).getColor(), onlyColors, regionExtensionType == RegionExtensionType.EXTENSION, getMinPoint(regionType, regionExtensionType), getMaxPoint(regionType, regionExtensionType), waterLevel, regionType == RegionType.TESTBLOCK); Point pastePoint; File tempFile = null;