Fix /plot auto performance and remove sign-guessing

This commit is contained in:
Alexander Söderberg 2020-04-07 23:39:56 +02:00
parent 0d4af3023d
commit 283ff945f3
3 changed files with 102 additions and 99 deletions

View File

@ -285,15 +285,15 @@ public class BukkitChunkManager extends ChunkManager {
int zzb = z << 4;
int xxt = xxb + 15;
int zzt = zzb + 15;
Chunk chunkObj = worldObj.getChunkAt(x, z);
if (!chunkObj.load(false)) {
continue;
PaperLib.getChunkAtAsync(worldObj, x, z, false).thenAccept(chunkObj -> {
if (chunkObj == null) {
return;
}
final LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(world, false);
if (xxb >= p1x && xxt <= p2x && zzb >= p1z && zzt <= p2z) {
AugmentedUtils.bypass(ignoreAugment,
() -> queue.regenChunkSafe(chunk.getX(), chunk.getZ()));
continue;
return;
}
boolean checkX1 = false;
@ -390,6 +390,7 @@ public class BukkitChunkManager extends ChunkManager {
}, world, chunk));
//map.restoreBlocks(worldObj, 0, 0);
map.restoreEntities(worldObj, 0, 0);
});
}
if (!chunks.isEmpty()) {
TaskManager.runTaskLater(this, 1);

View File

@ -352,5 +352,7 @@ public class Settings extends Config {
public static boolean EXTERNAL_PLACEHOLDERS = true;
@Comment("Make road regeneration persistent across restarts") public static boolean
PERSISTENT_ROAD_REGEN = false;
@Comment("Try to guess plot owners from sign data. This may decrease server performance")
public static boolean GUESS_PLOT_OWNER = false;
}
}

View File

@ -2368,7 +2368,7 @@ public class Plot {
if (this.hasOwner()) {
return this.owner;
}
if (!this.area.allowSigns()) {
if (!this.area.allowSigns() || !Settings.Enabled_Components.GUESS_PLOT_OWNER) {
return null;
}
try {