TntMode #163
@ -46,7 +46,7 @@ public class CommandTestblock implements CommandExecutor {
|
||||
}
|
||||
|
||||
for(Region region : Region.getRegions()){
|
||||
if(region.inRegion(player.getLocation())){
|
||||
if(region.inRegion(player.getLocation()) && region.hasTestblock()){
|
||||
try {
|
||||
Schematic schem = null;
|
||||
if(args.length > 0){
|
||||
|
@ -101,6 +101,10 @@ public class Region {
|
||||
prototype.reset(this, schem);
|
||||
}
|
||||
|
||||
public boolean hasTestblock() {
|
||||
return prototype.hasTestblock();
|
||||
}
|
||||
|
||||
public void resetTestblock(Schematic schem) throws IOException, NoClipboardException{
|
||||
prototype.resetTestblock(this, schem);
|
||||
}
|
||||
@ -114,7 +118,6 @@ public class Region {
|
||||
}
|
||||
|
||||
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 final int sizeX;
|
||||
@ -165,7 +168,7 @@ public class 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 y = region.minY + offsetY;
|
||||
int z = region.minZ + offsetZ + sizeZ/2;
|
||||
@ -184,12 +187,12 @@ public class Region {
|
||||
int y = region.minY + offsetY;
|
||||
int z = region.minZ + offsetZ + sizeZ / 2;
|
||||
if(schem == null)
|
||||
paste(new File(SECTION_PATH + schematic), x, y, z, rotate);
|
||||
paste(new File(schematic), x, y, z, rotate);
|
||||
else
|
||||
paste(schem.load(), x, y, z, rotate);
|
||||
}
|
||||
|
||||
public boolean hasProtection(){
|
||||
public boolean hasProtection() {
|
||||
return protectSchematic != null;
|
||||
}
|
||||
|
||||
@ -198,11 +201,15 @@ public class Region {
|
||||
int y = region.minY + testblock.offsetY - 1;
|
||||
int z = region.minZ + offsetZ + sizeZ / 2;
|
||||
if(schem == null)
|
||||
paste(new File(SECTION_PATH + protectSchematic), x, y, z, rotate);
|
||||
paste(new File(protectSchematic), x, y, z, rotate);
|
||||
else
|
||||
paste(schem.load(), x, y, z, rotate);
|
||||
}
|
||||
|
||||
public boolean hasTestblock() {
|
||||
return testblock != null;
|
||||
}
|
||||
|
||||
public void resetTestblock(Region region, Schematic schem) throws IOException, NoClipboardException {
|
||||
testblock.reset(region, schem);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren