This commit is contained in:
boy0001 2015-07-26 14:11:18 +10:00
parent 4231ae6755
commit 08cc8c58f2
7 changed files with 23 additions and 40 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<artifactId>PlotSquared</artifactId>
<version>2.12.18</version>
<version>2.12.19</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -65,24 +65,6 @@ public class DebugExec extends SubCommand {
if (args.length > 0) {
final String arg = args[0].toLowerCase();
switch (arg) {
case "biome": {
if (player == null) {
MainUtil.sendMessage(player, C.IS_CONSOLE);
return false;
}
Location loc = player.getLocation();
World world = Bukkit.getWorld(loc.getWorld());
int bx = (loc.getX() >> 4) << 4;
int bz = (loc.getZ() >> 4) << 4;
for (int x = bx; x < bx + 16; x++) {
for (int z = bz; z < bz + 16; z++) {
world.setBiome(x, z, Biome.DESERT);
}
}
MainUtil.update(loc.getWorld(), new ChunkLoc(loc.getX() >> 4, loc.getZ() >> 4));
System.out.print("SET BIOME TO FOREST: " + bx + "," + bz);
return true;
}
case "analyze": {
if (player == null) {
MainUtil.sendMessage(player, C.IS_CONSOLE);

View File

@ -69,18 +69,21 @@ public class Delete extends SubCommand {
sendMessage(plr, C.ADDED_BALANCE, c + "");
}
}
PS.get().removePlot(loc.getWorld(), plot.id, true);
final long start = System.currentTimeMillis();
final boolean result = MainUtil.clearAsPlayer(plot, true, new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start));
if (plot.unclaim()) {
final long start = System.currentTimeMillis();
final boolean result = MainUtil.clearAsPlayer(plot, true, new Runnable() {
@Override
public void run() {
MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start));
}
});
if (!result) {
MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER);
}
});
if (!result) {
MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER);
}
DBFunc.delete(plot);
else {
MainUtil.sendMessage(plr, C.UNCLAIM_FAILED);
}
}
};
if (Settings.CONFIRM_DELETE && !(Permissions.hasPermission(plr, "plots.confirm.bypass"))) {

View File

@ -57,13 +57,12 @@ public class Unclaim extends SubCommand {
sendMessage(plr, C.ADDED_BALANCE, c + "");
}
}
final boolean result = PS.get().removePlot(loc.getWorld(), plot.id, true);
if (result) {
plot.unclaim();
} else {
MainUtil.sendMessage(plr, "Plot removal has been denied.");
if (plot.unclaim()) {
MainUtil.sendMessage(plr, C.UNCLAIM_SUCCESS);
}
else {
MainUtil.sendMessage(plr, C.UNCLAIM_FAILED);
}
MainUtil.sendMessage(plr, C.UNCLAIM_SUCCESS);
return true;
}
}

View File

@ -99,6 +99,7 @@ public enum C {
* Unclaim
*/
UNCLAIM_SUCCESS("$4You successfully unclaimed the plot.", "Unclaim"),
UNCLAIM_FAILED("$2Could not unclaim the plot", "Unclaim"),
/*
* WorldEdit masks
*/

View File

@ -336,10 +336,12 @@ public class Plot {
});
}
public void unclaim() {
public boolean unclaim() {
if (PS.get().removePlot(world, id, true)) {
DBFunc.delete(Plot.this);
return true;
}
return false;
}
/**

View File

@ -233,7 +233,6 @@ public abstract class SchematicHandler {
for (int ry = 0; ry < Math.min(256, HEIGHT); ry++) {
int yy = y_offset + ry;
if (yy > 255) {
System.out.print("TOO HIGH: " + ry);
continue;
}
int i1 = ry * WIDTH * LENGTH;
@ -323,7 +322,6 @@ public abstract class SchematicHandler {
break;
}
default: {
System.out.print(id +","+datas[i]);
SetBlockQueue.setBlock(plot.world, xx, yy, zz, new PlotBlock((short) id, (byte) datas[i]));
break;
}
@ -444,8 +442,6 @@ public abstract class SchematicHandler {
// }
// Schematic schem = new Schematic(collection, dimension, file);
System.out.print(width + "," + height +"," + length);
Dimension dimensions = new Dimension(width, height, length);
Schematic schem = new Schematic(block, data, dimensions);