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 22b0048..6c6406f 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 @@ -19,7 +19,6 @@ package de.steamwar.bausystem.world.regions; -import com.google.common.collect.Sets; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; @@ -64,7 +63,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); @@ -78,11 +77,11 @@ 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) { + System.out.println(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()); - if (pasteOptions.isReset() && pasteOptions.getWaterLevel() != 0) { - System.out.println(e.replaceBlocks(new CuboidRegion(RegionUtils_15.toBlockVector3(pasteOptions.getMinPoint()), RegionUtils_15.toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), new HashSet<>(Arrays.asList(BlockTypes.AIR.getDefaultState().toBaseBlock())), BlockTypes.WATER.getDefaultState().toBaseBlock())); - } return e; } catch (WorldEditException e) { throw new SecurityException(e.getMessage(), e);