script compile time optimizations.

This commit is contained in:
gnembon committed 2021-05-05 00:25:31 -03:00
1 parent 06c9aea326
commit 8d97ab26a9
27 files changed
+1071 -193

No files matched your search

@@ -796,7 +796,7 @@ public class Auxiliary {
return Value.TRUE;
});
expression.addFunction("logger", lv ->
expression.addImpureFunction("logger", lv ->
{
Value res;
@@ -25,7 +25,7 @@ public class Threading
});
// has to be lazy due to deferred execution of the expression
expression.addLazyFunctionWithDelegation("task_dock", 1, (c, t, expr, tok, lv) -> {
expression.addLazyFunctionWithDelegation("task_dock", 1, false,true, (c, t, expr, tok, lv) -> {
CarpetContext cc = (CarpetContext)c;
MinecraftServer server = cc.s.getMinecraftServer();
if (server.isOnThread()) return lv.get(0); // pass through for on thread tasks