diff --git a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java index 4e7e57ac..5acf6d52 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java @@ -147,7 +147,6 @@ public class FlatteningWrapper15 implements FlatteningWrapper { changeColor(clipboard, pasteOptions.getColor()); } - Set blocks = new HashSet<>(); { blocks.add("minecraft:" + pasteOptions.getColor().name().toLowerCase() + "_wool"); @@ -174,6 +173,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper { } catch (WorldEditException ex) { throw new RuntimeException(ex); } + if (blockName.startsWith("minecraft:tnt")) return false; } 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 a677e4df..e7ddb346 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); + region.reset(RegionType.TESTBLOCK, regionExtensionType, regionExtensionType == null); 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); + region.reset(node, RegionType.TESTBLOCK, regionExtensionType,true); RegionUtils.message(region, "REGION_TB_DONE"); } catch (IOException e) { BauSystem.MESSAGE.send("REGION_TB_ERROR", p); @@ -101,6 +101,8 @@ public class TestblockCommand extends SWCommand { showModeParameterTypesMap.put("-n", RegionExtensionType.NORMAL); showModeParameterTypesMap.put("-extension", RegionExtensionType.EXTENSION); showModeParameterTypesMap.put("-e", RegionExtensionType.EXTENSION); + showModeParameterTypesMap.put("-t", null); + showModeParameterTypesMap.put("-tnt", null); List tabCompletes = new ArrayList<>(showModeParameterTypesMap.keySet()); return SWCommandUtils.createMapper(s -> showModeParameterTypesMap.getOrDefault(s, null), s -> tabCompletes); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java b/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java index fe64f44c..ca151b54 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/PasteOptions.java @@ -45,4 +45,6 @@ public class PasteOptions { private final int waterLevel; private final boolean testBlock; + + private final boolean removeTNT; } \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index 2f79be02..83928d91 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -421,25 +421,25 @@ public class Region { reset(schematic, regionType, RegionExtensionType.NORMAL, false); } - public void reset(RegionType regionType, RegionExtensionType regionExtensionType) throws IOException { - reset(null, regionType, regionExtensionType); + public void reset(RegionType regionType, RegionExtensionType regionExtensionType,boolean removeTNT) throws IOException { + reset(null, regionType, regionExtensionType,removeTNT); } - public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType) throws IOException { - reset(schematic, regionType, regionExtensionType, false); + public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType,boolean removeTNT) throws IOException { + reset(schematic, regionType, regionExtensionType, false,removeTNT); } public void reset(File file) { - EditSession editSession = paste(file, minPoint.add(prototype.getSizeX() / 2, 0, prototype.getSizeZ() / 2), new PasteOptions(false, false, Color.YELLOW, false, false, getMinPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), getMaxPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), waterLevel, false)); + EditSession editSession = paste(file, minPoint.add(prototype.getSizeX() / 2, 0, prototype.getSizeZ() / 2), new PasteOptions(false, false, Color.YELLOW, false, false, getMinPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), getMaxPoint(RegionType.NORMAL, RegionExtensionType.NORMAL), waterLevel, false,false)); initSessions(); undoSessions.push(editSession); } - 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 removeTNT) throws IOException { + reset(schematic, regionType, regionExtensionType, ignoreAir, false,removeTNT); } - public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors) throws IOException { + public void reset(SchematicNode schematic, RegionType regionType, RegionExtensionType regionExtensionType, boolean ignoreAir, boolean onlyColors,boolean removeTNT) 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, regionType == RegionType.TESTBLOCK); + 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,removeTNT); Point pastePoint; File tempFile = null;