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,11 +147,12 @@ public class Prototype {
int x = region.minPoint.getX() + offsetX + sizeX / 2; int x = region.minPoint.getX() + offsetX + sizeX / 2;
int y = region.minPoint.getY() + offsetY; int y = region.minPoint.getY() + offsetY;
int z = region.minPoint.getZ() + offsetZ + sizeZ / 2; int z = region.minPoint.getZ() + offsetZ + sizeZ / 2;
if (schem == null) if (schem == null) {
return paste(new File(schematic), x, y, z, rotate); return paste(new File(schematic), x, y, z, rotate);
else } else {
return paste(schem.load(), x, y, z, rotate); return paste(schem.load(), x, y, z, rotate);
} }
}
public boolean hasProtection() { public boolean hasProtection() {
return protectSchematic != null; return protectSchematic != null;
@ -161,11 +162,12 @@ public class Prototype {
int x = region.minPoint.getX() + offsetX + sizeX / 2; int x = region.minPoint.getX() + offsetX + sizeX / 2;
int y = region.minPoint.getY() + testblock.offsetY - 1; int y = region.minPoint.getY() + testblock.offsetY - 1;
int z = region.minPoint.getZ() + offsetZ + sizeZ / 2; int z = region.minPoint.getZ() + offsetZ + sizeZ / 2;
if (schem == null) if (schem == null) {
return paste(new File(protectSchematic), x, y, z, rotate); return paste(new File(protectSchematic), x, y, z, rotate);
else } else {
return paste(schem.load(), x, y, z, rotate); return paste(schem.load(), x, y, z, rotate);
} }
}
public boolean hasTestblock() { public boolean hasTestblock() {
return testblock != null; return testblock != null;

Datei anzeigen

@ -20,10 +20,8 @@
package de.steamwar.bausystem.world.regions; package de.steamwar.bausystem.world.regions;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import de.steamwar.bausystem.commands.CommandTNT.TNTMode; import de.steamwar.bausystem.commands.CommandTNT.TNTMode;
import de.steamwar.bausystem.world.SizedStack; import de.steamwar.bausystem.world.SizedStack;
import de.steamwar.core.VersionedCallable;
import de.steamwar.sql.NoClipboardException; import de.steamwar.sql.NoClipboardException;
import de.steamwar.sql.Schematic; import de.steamwar.sql.Schematic;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -34,7 +32,9 @@ import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File; import java.io.File;
import java.io.IOException; 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.function.Consumer;
import java.util.logging.Level; import java.util.logging.Level;
@ -75,7 +75,9 @@ public class Region {
public static Region getRegion(Location location) { public static Region getRegion(Location location) {
for (Region region : regions) { 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(); return GlobalRegion.getInstance();
} }
@ -230,7 +232,7 @@ public class Region {
} }
private void initSessions() { private void initSessions() {
if(undosessions == null) { if (undosessions == null) {
undosessions = new SizedStack<>(20); undosessions = new SizedStack<>(20);
redosessions = new SizedStack<>(20); redosessions = new SizedStack<>(20);
} }
@ -241,8 +243,9 @@ public class Region {
EditSession session = null; EditSession session = null;
try { try {
session = undosessions.pop(); session = undosessions.pop();
if(session == null) if (session == null) {
return false; return false;
}
session.undo(session); session.undo(session);
redosessions.push(session); redosessions.push(session);
return true; return true;
@ -258,8 +261,9 @@ public class Region {
EditSession session = null; EditSession session = null;
try { try {
session = redosessions.pop(); session = redosessions.pop();
if(session == null) if (session == null) {
return false; return false;
}
session.redo(session); session.redo(session);
undosessions.push(session); undosessions.push(session);
return true; return true;