mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-08-06 12:33:08 +00:00
Optimized fastmode clearing
This commit is contained in:
parent
e8b5edf50b
commit
6c68f88df9
2 changed files with 57 additions and 50 deletions
|
@ -289,6 +289,8 @@ public class BukkitChunkManager extends ChunkManager {
|
|||
final Integer task = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
long start = System.currentTimeMillis();
|
||||
while (System.currentTimeMillis() - start < 20) {
|
||||
if (chunks.size() == 0) {
|
||||
TaskManager.runTaskLater(whenDone, 1);
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
|
@ -348,6 +350,7 @@ public class BukkitChunkManager extends ChunkManager {
|
|||
}
|
||||
CURRENT_PLOT_CLEAR = null;
|
||||
}
|
||||
}
|
||||
}, 1, 1);
|
||||
TaskManager.tasks.put(currentIndex, task);
|
||||
return true;
|
||||
|
|
|
@ -151,7 +151,11 @@ public class BukkitUtil extends BlockManager {
|
|||
}
|
||||
|
||||
public static void regenerateChunk(final String world, final int x, final int z) {
|
||||
getWorld(world).regenerateChunk(x, z);
|
||||
World worldObj = getWorld(world);
|
||||
Chunk chunk = worldObj.getChunkAt(x, z);
|
||||
if (chunk.isLoaded() || chunk.load(false)) {
|
||||
worldObj.regenerateChunk(x, z);
|
||||
}
|
||||
}
|
||||
|
||||
public static PlotBlock getBlock(final Location loc) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue