Merge branch 'master' into 1.17

# Conflicts:
#	src/main/resources/carpet.mixins.json
This commit is contained in:
gnembon committed 2021-06-13 11:47:56 -03:00
commit dc38cd272f
7 files changed
+40 -24

No files matched your search

@@ -378,7 +378,7 @@ public class CarpetScriptHost extends ScriptHost
}
catch (CommandSyntaxException e)
{
notifier.accept(Messenger.c("Error when handling of setting up custom argument types: "+e.getMessage()));
notifier.accept(Messenger.c("r Error when handling of setting up custom argument types: "+e.getMessage()));
return false;
}
if (appConfig.get(StringValue.of("commands")) != null)
@@ -743,11 +743,8 @@ public class CarpetScriptHost extends ScriptHost
{
case VARIABLE:
LazyValue var = getGlobalVariable(tok.surface);
if (var != null)
{
argv.add(var);
break;
}
if (var != null) argv.add(var);
break;
case STRINGPARAM:
argv.add((c, t) -> new StringValue(tok.surface));
sign = "";
@@ -852,6 +852,7 @@ public class Expression
{
outputQueue.add(stack.pop());
}
break;
case MARKER:
if ("$".equals(token.surface))
{
@@ -436,8 +436,9 @@ public class ListValue extends AbstractListValue implements ContainerValueInterf
@Override
public Value get(Value value)
{
long index = NumericValue.asNumber(value, "'address' to a list index").getLong();
return items.get(normalizeIndex(index, items.size()));
int size = items.size();
if (size == 0) return Value.NULL;
return items.get(normalizeIndex(NumericValue.asNumber(value, "'address' to a list index").getLong(), size));
}
@Override