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 0c8a658..0ce643b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Prototype.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Prototype.java @@ -147,10 +147,11 @@ public class Prototype { int x = region.minPoint.getX() + offsetX + sizeX / 2; int y = region.minPoint.getY() + offsetY; int z = region.minPoint.getZ() + offsetZ + sizeZ / 2; - if (schem == null) + if (schem == null) { return paste(new File(schematic), x, y, z, rotate); - else + } else { return paste(schem.load(), x, y, z, rotate); + } } public boolean hasProtection() { @@ -161,10 +162,11 @@ public class Prototype { int x = region.minPoint.getX() + offsetX + sizeX / 2; int y = region.minPoint.getY() + testblock.offsetY - 1; int z = region.minPoint.getZ() + offsetZ + sizeZ / 2; - if (schem == null) + if (schem == null) { return paste(new File(protectSchematic), x, y, z, rotate); - else + } else { return paste(schem.load(), x, y, z, rotate); + } } public boolean hasTestblock() { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java index 3959bc5..e9aed03 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/regions/Region.java @@ -20,10 +20,8 @@ package de.steamwar.bausystem.world.regions; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.extent.clipboard.Clipboard; import de.steamwar.bausystem.commands.CommandTNT.TNTMode; import de.steamwar.bausystem.world.SizedStack; -import de.steamwar.core.VersionedCallable; import de.steamwar.sql.NoClipboardException; import de.steamwar.sql.Schematic; import org.bukkit.Bukkit; @@ -34,7 +32,9 @@ import org.bukkit.configuration.file.YamlConfiguration; import java.io.File; import java.io.IOException; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; import java.util.function.Consumer; import java.util.logging.Level; @@ -75,7 +75,9 @@ public class Region { public static Region getRegion(Location location) { for (Region region : regions) { - if (region.inRegion(location, RegionType.NORMAL, RegionExtensionType.NORMAL)) return region; + if (region.inRegion(location, RegionType.NORMAL, RegionExtensionType.NORMAL)) { + return region; + } } return GlobalRegion.getInstance(); } @@ -103,7 +105,7 @@ public class Region { public Region(String name) { this.name = name; - this.minPoint = new Point(0, 0, 0); + this.minPoint = new Point(0, 0, 0); this.prototype = null; this.optionsLinkedWith = null; tntMode = TNTMode.OFF; @@ -230,7 +232,7 @@ public class Region { } private void initSessions() { - if(undosessions == null) { + if (undosessions == null) { undosessions = new SizedStack<>(20); redosessions = new SizedStack<>(20); } @@ -241,8 +243,9 @@ public class Region { EditSession session = null; try { session = undosessions.pop(); - if(session == null) + if (session == null) { return false; + } session.undo(session); redosessions.push(session); return true; @@ -258,8 +261,9 @@ public class Region { EditSession session = null; try { session = redosessions.pop(); - if(session == null) + if (session == null) { return false; + } session.redo(session); undosessions.push(session); return true;