SteamWar/BauSystem
Archiviert
13
0

TntMode #163

Manuell gemergt
YoyoNow hat 8 Commits von TntMode nach master 2021-01-24 20:19:52 +01:00 zusammengeführt
2 geänderte Dateien mit 13 neuen und 6 gelöschten Zeilen
Nur Änderungen aus Commit 76359c9c38 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -46,7 +46,7 @@ public class CommandTestblock implements CommandExecutor {
} }
for(Region region : Region.getRegions()){ for(Region region : Region.getRegions()){
if(region.inRegion(player.getLocation())){ if(region.inRegion(player.getLocation()) && region.hasTestblock()){
try { try {
Schematic schem = null; Schematic schem = null;
if(args.length > 0){ if(args.length > 0){

Datei anzeigen

@ -101,6 +101,10 @@ public class Region {
prototype.reset(this, schem); prototype.reset(this, schem);
} }
public boolean hasTestblock() {
return prototype.hasTestblock();
}
public void resetTestblock(Schematic schem) throws IOException, NoClipboardException{ public void resetTestblock(Schematic schem) throws IOException, NoClipboardException{
prototype.resetTestblock(this, schem); prototype.resetTestblock(this, schem);
} }
@ -114,7 +118,6 @@ public class Region {
} }
public static class Prototype{ public static class Prototype{
private static final String SECTION_PATH = "/home/minecraft/backbone/server/UserBau/";
private static final Map<String, Prototype> prototypes = new HashMap<>(); private static final Map<String, Prototype> prototypes = new HashMap<>();
private final int sizeX; private final int sizeX;
@ -165,7 +168,7 @@ public class Region {
} }
public void fastreset(Region region){ public void fastreset(Region region){
File file = new File(SECTION_PATH + schematic); File file = new File(schematic);
int x = region.minX + offsetX + sizeX/2; int x = region.minX + offsetX + sizeX/2;
int y = region.minY + offsetY; int y = region.minY + offsetY;
int z = region.minZ + offsetZ + sizeZ/2; int z = region.minZ + offsetZ + sizeZ/2;
@ -184,12 +187,12 @@ public class Region {
int y = region.minY + offsetY; int y = region.minY + offsetY;
int z = region.minZ + offsetZ + sizeZ / 2; int z = region.minZ + offsetZ + sizeZ / 2;
if(schem == null) if(schem == null)
paste(new File(SECTION_PATH + schematic), x, y, z, rotate); paste(new File(schematic), x, y, z, rotate);
else else
paste(schem.load(), x, y, z, rotate); paste(schem.load(), x, y, z, rotate);
} }
public boolean hasProtection(){ public boolean hasProtection() {
return protectSchematic != null; return protectSchematic != null;
} }
@ -198,11 +201,15 @@ public class Region {
int y = region.minY + testblock.offsetY - 1; int y = region.minY + testblock.offsetY - 1;
int z = region.minZ + offsetZ + sizeZ / 2; int z = region.minZ + offsetZ + sizeZ / 2;
if(schem == null) if(schem == null)
paste(new File(SECTION_PATH + protectSchematic), x, y, z, rotate); paste(new File(protectSchematic), x, y, z, rotate);
else else
paste(schem.load(), x, y, z, rotate); paste(schem.load(), x, y, z, rotate);
} }
public boolean hasTestblock() {
return testblock != null;
}
public void resetTestblock(Region region, Schematic schem) throws IOException, NoClipboardException { public void resetTestblock(Region region, Schematic schem) throws IOException, NoClipboardException {
testblock.reset(region, schem); testblock.reset(region, schem);
} }