SteamWar/BauSystem
Archiviert
13
0

Update to new Code style

Dieser Commit ist enthalten in:
yoyosource 2021-04-03 20:28:29 +02:00
Ursprung bdc9e44e2a
Commit e90dda786b
2 geänderte Dateien mit 18 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -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() {

Datei anzeigen

@ -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;