From a3227525494fab591c2febf4c580882e71860440 Mon Sep 17 00:00:00 2001 From: Sir_Gavith <63616979+SirGavith@users.noreply.github.com> Date: Sun, 2 Aug 2020 21:31:55 -0700 Subject: [PATCH 1/3] Corrected while() documentation (#400) * Corrected while() args Added `expr` to the args of while() in the documentation * Corrected while() args Added `expr` to the args of while() in the documentation * Update docs/scarpet/language/LoopsAndHigherOrderFunctions.md Co-authored-by: James103 <37945304+James103@users.noreply.github.com> Co-authored-by: James103 <37945304+James103@users.noreply.github.com> --- docs/scarpet/Full.md | 2 +- docs/scarpet/language/LoopsAndHigherOrderFunctions.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/scarpet/Full.md b/docs/scarpet/Full.md index 401bdc56..241f34a5 100644 --- a/docs/scarpet/Full.md +++ b/docs/scarpet/Full.md @@ -1109,7 +1109,7 @@ for(range(1000000,1100000),check_prime(_)) => 7216 From which we can learn that there is 7216 primes between 1M and 1.1M -### `while(cond, limit)` +### `while(cond, limit,expr)` Evaluates expression `expr` repeatedly until condition `cond` becomes false, but not more than `limit` times. Returns the result of the last `expr` evaluation, or `null` if nothing was successful. Both `expr` and `cond` will diff --git a/docs/scarpet/language/LoopsAndHigherOrderFunctions.md b/docs/scarpet/language/LoopsAndHigherOrderFunctions.md index 82fdacd3..fa3ab931 100644 --- a/docs/scarpet/language/LoopsAndHigherOrderFunctions.md +++ b/docs/scarpet/language/LoopsAndHigherOrderFunctions.md @@ -49,7 +49,7 @@ for(range(1000000,1100000),check_prime(_)) => 7216 From which we can learn that there is 7216 primes between 1M and 1.1M -### `while(cond, limit)` +### `while(cond, limit, expr)` Evaluates expression `expr` repeatedly until condition `cond` becomes false, but not more than `limit` times. Returns the result of the last `expr` evaluation, or `null` if nothing was successful. Both `expr` and `cond` will @@ -145,4 +145,4 @@ it will be used from now on as a new value for the accumulator.
 reduce([1,2,3,4],_a+_,0)  => 10
 reduce([1,2,3,4],_a*_,1)  => 24
-
\ No newline at end of file + From 3dc5f713ab9ed99de2066ce2852d418a91fc6c30 Mon Sep 17 00:00:00 2001 From: Ghoulboy Date: Mon, 3 Aug 2020 06:32:26 +0200 Subject: [PATCH 2/3] added "ops" setting to each rule (#390) * added "ops" setting to each rule * removing changes * implementing gnembon's fix * removing unnecessary stuffs * removing unnecessary changes v2 * removing unnecessary changes v3 * Separating bool from command --- src/main/java/carpet/settings/ParsedRule.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/carpet/settings/ParsedRule.java b/src/main/java/carpet/settings/ParsedRule.java index f25b0a38..54d352b7 100644 --- a/src/main/java/carpet/settings/ParsedRule.java +++ b/src/main/java/carpet/settings/ParsedRule.java @@ -61,9 +61,12 @@ public final class ParsedRule implements Comparable { { this.options = ImmutableList.copyOf(rule.options()); } - else if (this.type == boolean.class || (this.type == String.class && categories.contains(RuleCategory.COMMAND))) + else if (this.type == boolean.class){ + this.options = ImmutableList.of("true","false"); + } + else if(this.type == String.class && categories.contains(RuleCategory.COMMAND)) { - this.options = ImmutableList.of("true", "false"); + this.options = ImmutableList.of("true", "false", "ops"); } else if (this.type.isEnum()) { From 4882480e9e25c678d3cd1f7abd52cdfb3f8692be Mon Sep 17 00:00:00 2001 From: gnembon Date: Tue, 4 Aug 2020 04:15:57 -0300 Subject: [PATCH 3/3] fixing titles --- docs/scarpet/api/Entities.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scarpet/api/Entities.md b/docs/scarpet/api/Entities.md index 3bf577ce..18157bb9 100644 --- a/docs/scarpet/api/Entities.md +++ b/docs/scarpet/api/Entities.md @@ -155,12 +155,12 @@ query(e,'custom_name') => null query(e,'type') => villager -## `query(e, 'command_name')` +### `query(e, 'command_name')` Returns a valid string to be used in commands to address an entity. Its UUID for all entities except player, where its their name. -## `query(e, 'persistence')` +### `query(e, 'persistence')` Returns if a mob has a persistence tag or not. Returns `null` for non-mob entities.