Fixes #905
Fixes auto claim limit
This commit is contained in:
Jesse Boyd 2016-02-29 04:08:29 +11:00
parent 911bef974a
commit 5c4178b1dd
4 changed files with 16 additions and 8 deletions

View file

@ -288,6 +288,7 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
// Set the result data
result.result = new short[16][];
result.result_data = new byte[16][];
result.grid = grid;
// Catch any exceptions (as exceptions usually thrown
try {
// Fill the result data

View file

@ -116,6 +116,7 @@ public class Auto extends SubCommand {
if ((diff + (size_x * size_z)) > 0) {
if (diff < 0) {
MainUtil.sendMessage(plr, C.CANT_CLAIM_MORE_PLOTS_NUM, (-diff) + "");
return false;
} else if (plr.hasPersistentMeta("grantedPlots")) {
int grantedPlots = ByteArrayUtilities.bytesToInteger(plr.getPersistentMeta("grantedPlots"));
if (grantedPlots - diff < size_x * size_z) {
@ -133,6 +134,7 @@ public class Auto extends SubCommand {
}
} else {
MainUtil.sendMessage(plr, C.CANT_CLAIM_MORE_PLOTS);
return false;
}
}
if ((EconHandler.manager != null) && plotarea.USE_ECONOMY) {

View file

@ -769,25 +769,30 @@ public class Plot {
final Runnable run = new Runnable() {
@Override
public void run() {
if (finished.incrementAndGet() >= plots.size()) {
for (final RegionWrapper region : regions) {
final Location[] corners = region.getCorners(Plot.this.area.worldname);
ChunkManager.manager.clearAllEntities(corners[0], corners[1]);
}
TaskManager.runTask(whenDone);
for (final RegionWrapper region : regions) {
final Location[] corners = region.getCorners(Plot.this.area.worldname);
ChunkManager.manager.clearAllEntities(corners[0], corners[1]);
}
TaskManager.runTask(whenDone);
}
};
if (isDelete) {
for (final Plot current : plots) {
manager.unclaimPlot(Plot.this.area, current, run);
manager.unclaimPlot(Plot.this.area, current, new Runnable() {
@Override
public void run() {
if (finished.incrementAndGet() >= plots.size()) {
run.run();
}
}
});
}
} else {
for (final Plot current : plots) {
manager.claimPlot(Plot.this.area, current);
}
SetQueue.IMP.addTask(run);
}
SetQueue.IMP.addTask(run);
return;
}
final Plot current = queue.poll();

Binary file not shown.