This commit is contained in:
cyberpwn 2021-08-26 06:07:39 -04:00
parent 04de362bc9
commit 3b61b87501
2 changed files with 16 additions and 1 deletions

View File

@ -18,6 +18,7 @@
package com.volmit.iris.core.pregenerator.methods;
import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.core.pregenerator.PregenListener;
import com.volmit.iris.core.pregenerator.PregeneratorMethod;
@ -48,6 +49,12 @@ public class AsyncPregenMethod implements PregeneratorMethod {
private void unloadAndSaveAllChunks() {
try {
J.sfut(() -> {
if(world == null)
{
Iris.warn("World was null somehow...");
return;
}
for (Chunk i : world.getLoadedChunks()) {
i.unload(true);
}

View File

@ -256,7 +256,15 @@ public class J {
* @param delay the delay to wait in ticks before running
*/
public static void s(Runnable r, int delay) {
Bukkit.getScheduler().scheduleSyncDelayedTask(Iris.instance, r, delay);
try
{
Bukkit.getScheduler().scheduleSyncDelayedTask(Iris.instance, r, delay);
}
catch(Throwable e)
{
Iris.reportError(e);
}
}
/**