This commit is contained in:
cyberpwn 2021-09-25 14:18:30 -04:00
parent 4a594a8e4f
commit b6d9eb3dcc

View File

@ -67,6 +67,7 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.IllegalPluginAccessException;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
@ -298,15 +299,23 @@ public class Iris extends VolmitPlugin implements Listener {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public static void later(NastyRunnable object) { public static void later(NastyRunnable object) {
Bukkit.getScheduler().scheduleAsyncDelayedTask(instance, () -> try
{ {
try { Bukkit.getScheduler().scheduleAsyncDelayedTask(instance, () ->
object.run(); {
} catch (Throwable e) { try {
e.printStackTrace(); object.run();
Iris.reportError(e); } catch (Throwable e) {
} e.printStackTrace();
}, RNG.r.i(100, 1200)); Iris.reportError(e);
}
}, RNG.r.i(100, 1200));
}
catch(IllegalPluginAccessException ignored)
{
}
} }
public static int jobCount() { public static int jobCount() {