Merge branch 'master' into 1.17

# Conflicts:
#	src/main/java/carpet/network/ServerNetworkHandler.java
#	src/main/java/carpet/script/utils/SnoopyCommandSource.java
This commit is contained in:
gnembon committed 2021-04-19 23:42:38 -03:00
commit 709d74ea47
4 files changed
+112 -140

No files matched your search

@@ -669,13 +669,17 @@ public class Auxiliary {
ServerCommandSource s = ((CarpetContext)c).s;
try
{
Value[] error = {Value.NULL};
List<Value> output = new ArrayList<>();
Text[] error = {null};
List<Text> output = new ArrayList<>();
Value retval = new NumericValue(s.getMinecraftServer().getCommandManager().execute(
new SnoopyCommandSource(s, posf, error, output),
lv.get(0).evalValue(c).getString())
);
Value ret = ListValue.of(retval, ListValue.wrap(output), error[0]);
Value ret = ListValue.of(
retval,
ListValue.wrap(output.stream().map(FormattedTextValue::new).collect(Collectors.toList())),
FormattedTextValue.of(error[0])
);
return (c_, t_) -> ret;
}
catch (Exception exc)