Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-05-11 01:02:12 -03:00
commit 9512eb7af5
2 files changed
+2 -2

No files matched your search

@@ -2812,7 +2812,7 @@ public class CarpetExpression
this.expr.addLazyFunction("task_dock", 1, (c, t, lv) -> {
CarpetContext cc = (CarpetContext)c;
MinecraftServer server = cc.s.getMinecraftServer();
if (server.isOnThread()) return lv.get(1); // pass through for on thread tasks
if (server.isOnThread()) return lv.get(0); // pass through for on thread tasks
Value[] result = new Value[]{Value.NULL};
((CarpetContext) c).s.getMinecraftServer().submitAndJoin(() -> result[0] = lv.get(0).evalValue(c, t));
Value ret = result[0]; // preventing from lazy evaluating of the result in case a future completes later
@@ -48,7 +48,7 @@ public abstract class LazyListValue extends AbstractListValue implements Iterato
@Override
public String getString()
{
return String.format(Locale.ROOT, "[%d, %d, ..., %d]",start, start+stepp, limit);
return String.format(Locale.ROOT, "[%d, %d, ..., %d)",start, start+stepp, limit);
}
};
}