diff --git a/BauSystem_15/src/de/steamwar/bausystem/world/regions/Region_15.java b/BauSystem_15/src/de/steamwar/bausystem/world/regions/Region_15.java index 1c622f8..6bebb7f 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/world/regions/Region_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/world/regions/Region_15.java @@ -61,7 +61,7 @@ class Region_15 { static EditSession paste(Clipboard clipboard, int x, int y, int z, PasteOptions pasteOptions) { try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) { changeColor(clipboard, pasteOptions.getColor()); - + ClipboardHolder ch = new ClipboardHolder(clipboard); BlockVector3 dimensions = clipboard.getDimensions(); BlockVector3 v = BlockVector3.at(x, y, z); @@ -75,6 +75,9 @@ class Region_15 { if (pasteOptions.isReset()) { e.setBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint())), BlockTypes.AIR.getDefaultState().toBaseBlock()); + if (pasteOptions.getWaterLevel() != 0) { + e.setBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), BlockTypes.WATER.getDefaultState().toBaseBlock()); + } } Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteOptions.isIgnoreAir()).build()); return e; diff --git a/BauSystem_API/src/de/steamwar/bausystem/world/regions/PasteOptions.java b/BauSystem_API/src/de/steamwar/bausystem/world/regions/PasteOptions.java index 52e58ff..2dfbea0 100644 --- a/BauSystem_API/src/de/steamwar/bausystem/world/regions/PasteOptions.java +++ b/BauSystem_API/src/de/steamwar/bausystem/world/regions/PasteOptions.java @@ -59,6 +59,11 @@ public class PasteOptions { */ private Point maxPoint = null; + /** + * Used in 1.15 + */ + private int waterLevel = 0; + public PasteOptions(boolean rotate) { this.rotate = rotate; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java index 5ee1967..bd96756 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTestblock.java @@ -64,17 +64,12 @@ public class CommandTestblock extends SWCommand { } - @Register + @Register({"schem"}) public void schematicTestblockCommand(Player p, String s) { schematicTestblockCommand(p, s, RegionExtensionType.NORMAL); } - @Register - public void schematicTestblockCommand(Player p, RegionExtensionType regionExtensionType, String s) { - schematicTestblockCommand(p, s, regionExtensionType); - } - - @Register + @Register({"schem"}) public void schematicTestblockCommand(Player p, String s, RegionExtensionType regionExtensionType) { if (!permissionCheck(p)) return; Region region = regionCheck(p); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Prototype.java b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Prototype.java index 481e024..f3ab0d0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Prototype.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Prototype.java @@ -21,6 +21,7 @@ package de.steamwar.bausystem.world.regions; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.extent.clipboard.Clipboard; +import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.world.Color; import de.steamwar.core.VersionedCallable; import de.steamwar.sql.NoClipboardException; @@ -151,7 +152,7 @@ public class Prototype { public EditSession reset(Region region, Schematic schem, boolean ignoreAir, Color color, boolean reset) throws IOException, NoClipboardException { PasteOptions pasteOptions; if (reset) { - pasteOptions = new PasteOptions(rotate ^ (schem != null && (schem.getSchemType().fightType() || schem.getSchemType().check())), ignoreAir, color, true, getMinPoint(region, RegionExtensionType.EXTENSION), getMaxPoint(region, RegionExtensionType.EXTENSION)); + pasteOptions = new PasteOptions(rotate ^ (schem != null && (schem.getSchemType().fightType() || schem.getSchemType().check())), ignoreAir, color, true, getMinPoint(region, RegionExtensionType.EXTENSION), getMaxPoint(region, RegionExtensionType.EXTENSION), waterLevel); } else { pasteOptions = new PasteOptions(rotate ^ (schem != null && (schem.getSchemType().fightType() || schem.getSchemType().check())), ignoreAir, color); } @@ -186,7 +187,7 @@ public class Prototype { } public EditSession resetTestblock(Region region, Schematic schem, Color color, boolean reset) throws IOException, NoClipboardException { - return testblock.reset(region, schem, false, color, reset); + return testblock.reset(region, schem, false, color, reset && waterLevel == 0); } private static boolean inRange(double l, int min, int size) {