mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Pregenerator tweaks
This commit is contained in:
parent
7ead247fcb
commit
c828625cc1
@ -43,6 +43,7 @@ import lombok.Data;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@ -248,6 +249,7 @@ public class Pregenerator implements Listener {
|
||||
int mcaox = x << 5;
|
||||
int mcaoz = z << 5;
|
||||
if (isMCAWritable(x, z) && !mca.exists()) {
|
||||
IrisWorlds.evacuate(world, "MCA Pregeneration is ongoing");
|
||||
method.set("Direct (Fast)");
|
||||
mcaIteration.accept(mcaox, mcaoz, (ii, jj) -> e.queue(() -> {
|
||||
draw(ii, jj, COLOR_MCA_GENERATE);
|
||||
@ -259,8 +261,6 @@ public class Pregenerator implements Listener {
|
||||
}));
|
||||
e.complete();
|
||||
directWriter.flush();
|
||||
totalChunks.getAndAdd(1024);
|
||||
mcaDefer.add(new ChunkPosition(x, z));
|
||||
install(mcg, mca);
|
||||
} else {
|
||||
totalChunks.getAndAdd(1024);
|
||||
@ -308,8 +308,8 @@ public class Pregenerator implements Listener {
|
||||
if (PaperLib.isPaper()) {
|
||||
method.set("PaperAsync (Slow)");
|
||||
|
||||
while (wait.size() > 8192) {
|
||||
J.sleep(25);
|
||||
while (wait.size() > 32) {
|
||||
J.sleep(5);
|
||||
}
|
||||
|
||||
mcaIteration.accept(mcaox, mcaoz, (ii, jj) -> {
|
||||
|
@ -73,4 +73,19 @@ public class IrisWorlds {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean evacuate(World world, String m) {
|
||||
for (World i : Bukkit.getWorlds()) {
|
||||
if (!i.getName().equals(world.getName())) {
|
||||
for (Player j : world.getPlayers()) {
|
||||
new VolmitSender(j, Iris.instance.getTag()).sendMessage("You have been evacuated from this world. " + m);
|
||||
j.teleport(i.getSpawnLocation());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user