mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
fixes
This commit is contained in:
parent
42a3ec0561
commit
66d596b993
@ -106,6 +106,8 @@ public class PlotHelper {
|
|||||||
|
|
||||||
manager.startPlotMerge(world, plotworld, plotIds);
|
manager.startPlotMerge(world, plotworld, plotIds);
|
||||||
|
|
||||||
|
boolean result = false;
|
||||||
|
|
||||||
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++) {
|
||||||
|
|
||||||
@ -142,13 +144,14 @@ public class PlotHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (changed) {
|
if (changed) {
|
||||||
|
result = true;
|
||||||
DBFunc.setMerged(world.getName(), plot, plot.settings.getMerged());
|
DBFunc.setMerged(world.getName(), plot, plot.settings.getMerged());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.finishPlotMerge(world, plotworld, plotIds);
|
manager.finishPlotMerge(world, plotworld, plotIds);
|
||||||
return true;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -315,35 +318,49 @@ public class PlotHelper {
|
|||||||
|
|
||||||
ArrayList<PlotId> plots;
|
ArrayList<PlotId> plots;
|
||||||
boolean merge = true;
|
boolean merge = true;
|
||||||
|
int count = 0;
|
||||||
while (merge) {
|
while (merge) {
|
||||||
|
if (count>16) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
count++;
|
||||||
PlotId bot = PlayerFunctions.getBottomPlot(world, plot).id;
|
PlotId bot = PlayerFunctions.getBottomPlot(world, plot).id;
|
||||||
PlotId top = PlayerFunctions.getTopPlot(world, plot).id;
|
PlotId top = PlayerFunctions.getTopPlot(world, plot).id;
|
||||||
merge = false;
|
merge = false;
|
||||||
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x, bot.y - 1), new PlotId(top.x, top.y));
|
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x, bot.y - 1), new PlotId(top.x, top.y));
|
||||||
if (ownsPlots(world, plots, player, 0)) {
|
if (ownsPlots(world, plots, player, 0)) {
|
||||||
|
boolean result = mergePlots(world, plots);
|
||||||
|
if (result) {
|
||||||
merge = true;
|
merge = true;
|
||||||
mergePlots(world, plots);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x, bot.y), new PlotId(top.x + 1, top.y));
|
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x, bot.y), new PlotId(top.x + 1, top.y));
|
||||||
if (ownsPlots(world, plots, player, 1)) {
|
if (ownsPlots(world, plots, player, 1)) {
|
||||||
|
boolean result = mergePlots(world, plots);
|
||||||
|
if (result) {
|
||||||
merge = true;
|
merge = true;
|
||||||
mergePlots(world, plots);
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x, bot.y), new PlotId(top.x, top.y + 1));
|
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x, bot.y), new PlotId(top.x, top.y + 1));
|
||||||
if (ownsPlots(world, plots, player, 2)) {
|
if (ownsPlots(world, plots, player, 2)) {
|
||||||
|
boolean result = mergePlots(world, plots);
|
||||||
|
if (result) {
|
||||||
merge = true;
|
merge = true;
|
||||||
mergePlots(world, plots);
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x - 1, bot.y), new PlotId(top.x, top.y));
|
plots = PlayerFunctions.getPlotSelectionIds(world, new PlotId(bot.x - 1, bot.y), new PlotId(top.x, top.y));
|
||||||
if (ownsPlots(world, plots, player, 3)) {
|
if (ownsPlots(world, plots, player, 3)) {
|
||||||
|
boolean result = mergePlots(world, plots);
|
||||||
|
if (result) {
|
||||||
merge = true;
|
merge = true;
|
||||||
mergePlots(world, plots);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
merge = false;
|
||||||
|
}
|
||||||
if (canSetFast) {
|
if (canSetFast) {
|
||||||
SetBlockFast.update(player);
|
SetBlockFast.update(player);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ public class PlotId {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PlotId other = (PlotId) obj;
|
PlotId other = (PlotId) obj;
|
||||||
return ((this.x == other.x) && (this.y == other.y));
|
return (((int) this.x == (int) other.x) && ((int) this.y == (int) other.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -119,7 +119,7 @@ public class Auto extends SubCommand {
|
|||||||
if ((z < q) && ((z - x) < q)) {
|
if ((z < q) && ((z - x) < q)) {
|
||||||
z++;
|
z++;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
if (x < q) {
|
if (x < q) {
|
||||||
x++;
|
x++;
|
||||||
z = q - 100;
|
z = q - 100;
|
||||||
@ -131,6 +131,7 @@ public class Auto extends SubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
while (!br) {
|
while (!br) {
|
||||||
PlotId start = new PlotId(x, z);
|
PlotId start = new PlotId(x, z);
|
||||||
|
Loading…
Reference in New Issue
Block a user