@@ -0,0 +1,1163 @@
+package net.engin33r.luaspigot.lua.lib;%0A%0Aimport net.engin33r.luaspigot.lua.Library;%0Aimport net.engin33r.luaspigot.lua.annotation.LibFunctionDef;%0Aimport org.bukkit.Bukkit;%0Aimport org.bukkit.plugin.java.JavaPlugin;%0Aimport org.bukkit.scheduler.BukkitScheduler;%0Aimport org.luaj.vm2.LuaFunction;%0Aimport org.luaj.vm2.Varargs;%0A%0Aimport static org.luaj.vm2.LuaValue.NIL;%0A%0A/**%0A * Library for creating and managing Spigot async tasks.%0A */%0Apublic class AsyncLibrary extends Library %7B%0A    private final JavaPlugin plugin;%0A    private final BukkitScheduler scheduler;%0A%0A    public AsyncLibrary(JavaPlugin plugin) %7B%0A        this.plugin = plugin;%0A        this.scheduler = Bukkit.getScheduler();%0A    %7D%0A%0A    @Override%0A    public String getName() %7B%0A        return %22async%22;%0A    %7D%0A%0A    @LibFunctionDef(name = %22create%22)%0A    public Varargs create(Varargs args) %7B%0A        LuaFunction run = args.checkfunction(1);%0A        LuaFunction sync = args.optfunction(2, null);%0A        scheduler.runTaskAsynchronously(plugin, () -%3E %7B%0A            run.call();%0A            if (sync != null) %7B%0A                scheduler.runTask(plugin, sync::call);%0A            %7D%0A        %7D);%0A        return NIL;%0A    %7D%0A%7D%0A

Add async task library