mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Fixes #459
This commit is contained in:
parent
4231ae6755
commit
08cc8c58f2
2
pom.xml
2
pom.xml
@ -8,7 +8,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<artifactId>PlotSquared</artifactId>
|
<artifactId>PlotSquared</artifactId>
|
||||||
<version>2.12.18</version>
|
<version>2.12.19</version>
|
||||||
<name>PlotSquared</name>
|
<name>PlotSquared</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<build>
|
<build>
|
||||||
|
@ -65,24 +65,6 @@ public class DebugExec extends SubCommand {
|
|||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
final String arg = args[0].toLowerCase();
|
final String arg = args[0].toLowerCase();
|
||||||
switch (arg) {
|
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": {
|
case "analyze": {
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
MainUtil.sendMessage(player, C.IS_CONSOLE);
|
MainUtil.sendMessage(player, C.IS_CONSOLE);
|
||||||
|
@ -69,7 +69,7 @@ public class Delete extends SubCommand {
|
|||||||
sendMessage(plr, C.ADDED_BALANCE, c + "");
|
sendMessage(plr, C.ADDED_BALANCE, c + "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PS.get().removePlot(loc.getWorld(), plot.id, true);
|
if (plot.unclaim()) {
|
||||||
final long start = System.currentTimeMillis();
|
final long start = System.currentTimeMillis();
|
||||||
final boolean result = MainUtil.clearAsPlayer(plot, true, new Runnable() {
|
final boolean result = MainUtil.clearAsPlayer(plot, true, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -80,7 +80,10 @@ public class Delete extends SubCommand {
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER);
|
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"))) {
|
if (Settings.CONFIRM_DELETE && !(Permissions.hasPermission(plr, "plots.confirm.bypass"))) {
|
||||||
|
@ -57,13 +57,12 @@ public class Unclaim extends SubCommand {
|
|||||||
sendMessage(plr, C.ADDED_BALANCE, c + "");
|
sendMessage(plr, C.ADDED_BALANCE, c + "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final boolean result = PS.get().removePlot(loc.getWorld(), plot.id, true);
|
if (plot.unclaim()) {
|
||||||
if (result) {
|
|
||||||
plot.unclaim();
|
|
||||||
} else {
|
|
||||||
MainUtil.sendMessage(plr, "Plot removal has been denied.");
|
|
||||||
}
|
|
||||||
MainUtil.sendMessage(plr, C.UNCLAIM_SUCCESS);
|
MainUtil.sendMessage(plr, C.UNCLAIM_SUCCESS);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MainUtil.sendMessage(plr, C.UNCLAIM_FAILED);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,7 @@ public enum C {
|
|||||||
* Unclaim
|
* Unclaim
|
||||||
*/
|
*/
|
||||||
UNCLAIM_SUCCESS("$4You successfully unclaimed the plot.", "Unclaim"),
|
UNCLAIM_SUCCESS("$4You successfully unclaimed the plot.", "Unclaim"),
|
||||||
|
UNCLAIM_FAILED("$2Could not unclaim the plot", "Unclaim"),
|
||||||
/*
|
/*
|
||||||
* WorldEdit masks
|
* WorldEdit masks
|
||||||
*/
|
*/
|
||||||
|
@ -336,10 +336,12 @@ public class Plot {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unclaim() {
|
public boolean unclaim() {
|
||||||
if (PS.get().removePlot(world, id, true)) {
|
if (PS.get().removePlot(world, id, true)) {
|
||||||
DBFunc.delete(Plot.this);
|
DBFunc.delete(Plot.this);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -233,7 +233,6 @@ public abstract class SchematicHandler {
|
|||||||
for (int ry = 0; ry < Math.min(256, HEIGHT); ry++) {
|
for (int ry = 0; ry < Math.min(256, HEIGHT); ry++) {
|
||||||
int yy = y_offset + ry;
|
int yy = y_offset + ry;
|
||||||
if (yy > 255) {
|
if (yy > 255) {
|
||||||
System.out.print("TOO HIGH: " + ry);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int i1 = ry * WIDTH * LENGTH;
|
int i1 = ry * WIDTH * LENGTH;
|
||||||
@ -323,7 +322,6 @@ public abstract class SchematicHandler {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
System.out.print(id +","+datas[i]);
|
|
||||||
SetBlockQueue.setBlock(plot.world, xx, yy, zz, new PlotBlock((short) id, (byte) datas[i]));
|
SetBlockQueue.setBlock(plot.world, xx, yy, zz, new PlotBlock((short) id, (byte) datas[i]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -444,8 +442,6 @@ public abstract class SchematicHandler {
|
|||||||
// }
|
// }
|
||||||
// Schematic schem = new Schematic(collection, dimension, file);
|
// Schematic schem = new Schematic(collection, dimension, file);
|
||||||
|
|
||||||
System.out.print(width + "," + height +"," + length);
|
|
||||||
|
|
||||||
Dimension dimensions = new Dimension(width, height, length);
|
Dimension dimensions = new Dimension(width, height, length);
|
||||||
Schematic schem = new Schematic(block, data, dimensions);
|
Schematic schem = new Schematic(block, data, dimensions);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user