diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java index d8670c86..1e8ec13a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/lua/SteamWarLuaPlugin.java @@ -25,6 +25,7 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.extension.platform.Actor; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.features.script.ScriptRunner; import de.steamwar.bausystem.features.script.lua.libs.LuaLib; import de.steamwar.bausystem.features.world.WorldEditListener; import de.steamwar.bausystem.utils.WorldEditUtils; @@ -79,7 +80,7 @@ public class SteamWarLuaPlugin extends TwoArgFunction { LuaFunction callback = arg2.checkfunction(); SWAnvilInv inv = new SWAnvilInv(player, message); - inv.setCallback(s -> callback.call(valueOf(s))); + inv.setCallback(s -> ScriptRunner.catchScript("SCRIPT_ERROR_CLICK", player, () -> callback.call(valueOf(s)))); inv.open(); return LuaValue.NIL; @@ -91,7 +92,7 @@ public class SteamWarLuaPlugin extends TwoArgFunction { long time = arg1.checklong(); LuaFunction callback = arg2.checkfunction(); - Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> callback.call(), time); + Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> ScriptRunner.catchScript("SCRIPT_ERROR_CLICK", player, callback::call), time); return LuaValue.NIL; } });