Here you go.

This commit is contained in:
boy0001 2015-09-03 22:40:36 +10:00
parent dfc32741fa
commit 4e321d2b27
9 changed files with 11 additions and 9 deletions

View File

@ -111,6 +111,11 @@ public class Merge extends SubCommand {
} }
} }
else { else {
if (args[0].equalsIgnoreCase("all")) {
plot.autoMerge(args.length != 2 || !args[1].equalsIgnoreCase("false"));
MainUtil.sendMessage(plr, C.SUCCESS_MERGE);
return true;
}
for (int i = 0; i < values.length; i++) { for (int i = 0; i < values.length; i++) {
if (args[0].equalsIgnoreCase(values[i]) || args[0].equalsIgnoreCase(aliases[i])) { if (args[0].equalsIgnoreCase(values[i]) || args[0].equalsIgnoreCase(aliases[i])) {
direction = i; direction = i;

View File

@ -56,11 +56,10 @@ public class Unlink extends SubCommand {
if (MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) { if (MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) {
return sendMessage(plr, C.UNLINK_IMPOSSIBLE); return sendMessage(plr, C.UNLINK_IMPOSSIBLE);
} }
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
if (!MainUtil.unlinkPlot(plot)) { if (!MainUtil.unlinkPlot(plot, true)) {
MainUtil.sendMessage(plr, "&cUnlink has been cancelled"); MainUtil.sendMessage(plr, "&cUnlink has been cancelled");
return; return;
} }

View File

@ -595,11 +595,11 @@ public class Plot {
/** /**
* Unlink a plot and remove the roads * Unlink a plot and remove the roads
* @see MainUtil#unlinkPlot(Plot) * @see MainUtil#unlinkPlot(Plot, boolean removeRoad)
* @return true if plot was linked * @return true if plot was linked
*/ */
public boolean unlink() { public boolean unlink() {
return MainUtil.unlinkPlot(this); return MainUtil.unlinkPlot(this, true);
} }
/** /**

View File

@ -130,7 +130,7 @@ public class ExpireManager {
} }
} }
if (plot.isMerged()) { if (plot.isMerged()) {
MainUtil.unlinkPlot(plot); MainUtil.unlinkPlot(plot, true);
} }
plot.deletePlot(null); plot.deletePlot(null);
expiredPlots.get(world).remove(plot); expiredPlots.get(world).remove(plot);

View File

@ -298,7 +298,7 @@ public class MainUtil {
return MainUtil.mergePlots(world, plotIds, true, true); return MainUtil.mergePlots(world, plotIds, true, true);
} }
public static boolean unlinkPlot(final Plot plot) { public static boolean unlinkPlot(final Plot plot, boolean createRoad) {
final String world = plot.world; final String world = plot.world;
final PlotId pos1 = MainUtil.getBottomPlot(plot).id; final PlotId pos1 = MainUtil.getBottomPlot(plot).id;
final PlotId pos2 = MainUtil.getTopPlot(plot).id; final PlotId pos2 = MainUtil.getTopPlot(plot).id;
@ -324,7 +324,7 @@ public class MainUtil {
myplot.getSettings().setMerged(new boolean[] { false, false, false, false }); myplot.getSettings().setMerged(new boolean[] { false, false, false, false });
DBFunc.setMerged(myplot, myplot.getSettings().getMerged()); DBFunc.setMerged(myplot, myplot.getSettings().getMerged());
} }
if (plotworld.TERRAIN != 3) { if (plotworld.TERRAIN != 3 && createRoad) {
for (int x = pos1.x; x <= pos2.x; x++) { for (int x = pos1.x; x <= pos2.x; x++) {
for (int y = pos1.y; y <= pos2.y; y++) { for (int y = pos1.y; y <= pos2.y; y++) {
final boolean lx = x < pos2.x; final boolean lx = x < pos2.x;

View File

@ -53,7 +53,6 @@ public class Permissions {
if (player.hasPermission(stub + ".*")) { if (player.hasPermission(stub + ".*")) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }
System.out.print(range);
for (int i = range; i > 0; i--) { for (int i = range; i > 0; i--) {
if (player.hasPermission(stub + "." + i)) { if (player.hasPermission(stub + "." + i)) {
return i; return i;

View File

@ -81,7 +81,6 @@ public class BukkitPlayer extends PlotPlayer {
return EconHandler.manager.hasPermission(getName(), node); return EconHandler.manager.hasPermission(getName(), node);
} }
boolean value = this.player.hasPermission(node); boolean value = this.player.hasPermission(node);
System.out.print(value + " | " + node);
if (Settings.PERMISSION_CACHING) { if (Settings.PERMISSION_CACHING) {
if (value) { if (value) {
this.hasPerm.add(node); this.hasPerm.add(node);

Binary file not shown.

Binary file not shown.