Fix sync execute logic (fixes #16)

This commit is contained in:
Bryan Terce 2019-06-26 01:55:08 -07:00
parent 9a20da02a0
commit 33f4d5ff54

View File

@ -86,7 +86,7 @@ public class EffExecuteStatement extends Delay {
String result = executeStatement(e); String result = executeStatement(e);
continueScriptExecution(e, result); continueScriptExecution(e, result);
} else { } else {
if (isMainThread) { if (isSync) {
Skript.warning("A SQL query was attempted on the main thread!"); Skript.warning("A SQL query was attempted on the main thread!");
} }
@ -98,11 +98,7 @@ public class EffExecuteStatement extends Delay {
err.printStackTrace(); err.printStackTrace();
} }
if (isSync) {
continueScriptExecution(e, res);
} else {
Bukkit.getScheduler().runTask(SkriptDB.getInstance(), () -> continueScriptExecution(e, res)); Bukkit.getScheduler().runTask(SkriptDB.getInstance(), () -> continueScriptExecution(e, res));
}
}); });
} }
} }