From 3d9b136fa74d9ae323f1377759fe84881c45774c Mon Sep 17 00:00:00 2001 From: gnembon Date: Tue, 23 Jun 2020 02:05:42 -0300 Subject: [PATCH 1/2] fix docs --- docs/scarpet/api/Auxiliary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scarpet/api/Auxiliary.md b/docs/scarpet/api/Auxiliary.md index 8b4e712b..a276cde7 100644 --- a/docs/scarpet/api/Auxiliary.md +++ b/docs/scarpet/api/Auxiliary.md @@ -67,7 +67,7 @@ Optional shared shape attributes: in the form of `0xRRGGBBAA`, with the default of `-1`, so white opaque, or `0xFFFFFFFF`. * `player` - name or player entity to send the shape to. If specified, the shapes will appear only for the specified player, otherwise it will be send to all players in the dimension. - * `width` - line thickness, defaults to 2.0pt + * `line` - line thickness, defaults to 2.0pt * `fill` - color for the faces, defaults to no fill. Use `color` attribute format * `follow` - entity, or player name. Shape will follow an entity instead of being static. Follow attribute requires all positional arguments to be relative to the entity and disallow From 0e3395e7bd89824669b8857c4171c85b6223b3a7 Mon Sep 17 00:00:00 2001 From: gnembon Date: Tue, 23 Jun 2020 02:13:13 -0300 Subject: [PATCH 2/2] command crash when they throw weird exceptions --- src/main/java/carpet/script/CarpetExpression.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index 87eaa6b7..83e031a5 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -3082,9 +3082,14 @@ public class CarpetExpression BlockPos target = ((CarpetContext)c).origin; Vec3d posf = new Vec3d((double)target.getX()+0.5D,(double)target.getY(),(double)target.getZ()+0.5D); ServerCommandSource s = ((CarpetContext)c).s; - Value retval = new NumericValue(s.getMinecraftServer().getCommandManager().execute( - s.withPosition(posf).withSilent().withLevel(CarpetSettings.runPermissionLevel), lv.get(0).evalValue(c).getString())); - return (c_, t_) -> retval; + try + { + Value retval = new NumericValue(s.getMinecraftServer().getCommandManager().execute( + s.withPosition(posf).withSilent().withLevel(CarpetSettings.runPermissionLevel), lv.get(0).evalValue(c).getString())); + return (c_, t_) -> retval; + } + catch (Exception ignored) {} + return LazyValue.NULL; }); this.expr.addLazyFunction("save", 0, (c, t, lv) -> {