diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index 523e1dd2..81eba2ea 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -2254,6 +2254,11 @@ public class CarpetExpression * which indicates how far part you would want particles to appear, so 0.1 means one every 10cm.

*

particle_rect(name, pos, pos2, density?)

*

Renders a cuboid of particles between point pos to pos2 with supplied density.

+ *

Markers

+ *

create_marker(text, pos, rotation?, block?)

+ *

Spawns a (permanent) marker entity with text or block at position. Returns that entity for further manipulations

+ *

remove_all_markers()

+ *

Removes all scarpet markers from the loaded portion of the world in case you didn't want to do the cleanup

*

System function

*

nbt(expr)

*

Treats the argument as a nbt serializable string and returns its nbt value. diff --git a/src/main/java/carpet/script/Expression.java b/src/main/java/carpet/script/Expression.java index dec37f55..469d65fe 100644 --- a/src/main/java/carpet/script/Expression.java +++ b/src/main/java/carpet/script/Expression.java @@ -550,7 +550,7 @@ public class Expression implements Cloneable }); } - private RuntimeException handleCodeException(RuntimeException exc, Expression e, Tokenizer.Token token) + static RuntimeException handleCodeException(RuntimeException exc, Expression e, Tokenizer.Token token) { if (exc instanceof ExitStatement) return exc; diff --git a/src/main/java/carpet/script/Fluff.java b/src/main/java/carpet/script/Fluff.java index 082ecfdd..5cd29ad4 100644 --- a/src/main/java/carpet/script/Fluff.java +++ b/src/main/java/carpet/script/Fluff.java @@ -104,21 +104,9 @@ public abstract class Fluff } }; } - catch (InternalExpressionException exc) + catch (RuntimeException exc) { - throw new ExpressionException(e, t, exc.getMessage()); - } - catch (ArithmeticException exc) - { - throw new ExpressionException(e, t, "Your math is wrong, "+exc.getMessage()); - } - catch (Expression.ExitStatement exit) - { - throw exit; - } - catch (Exception exc) - { - throw new ExpressionException(e, t, "Error while evaluating expression: "+exc.getMessage()); + throw Expression.handleCodeException(exc, e, t); } } } @@ -158,21 +146,9 @@ public abstract class Fluff { return (c, type_ignored) -> AbstractOperator.this.eval(v1.evalValue(c), v2.evalValue(c)); } - catch (InternalExpressionException exc) + catch (RuntimeException exc) { - throw new ExpressionException(e, t, exc.getMessage()); - } - catch (ArithmeticException exc) - { - throw new ExpressionException(e, t, "Your math is wrong, "+exc.getMessage()); - } - catch (Expression.ExitStatement exit) - { - throw exit; - } - catch (Exception exc) - { - throw new ExpressionException(e, t, "Error while evaluating expression: "+exc.getMessage()); + throw Expression.handleCodeException(exc, e, t); } } } @@ -194,21 +170,9 @@ public abstract class Fluff } return (c, ignored_type) -> AbstractUnaryOperator.this.evalUnary(v1.evalValue(c)); } - catch (InternalExpressionException exc) // might not actually throw it + catch (RuntimeException exc) { - throw new ExpressionException(e, t, exc.getMessage()); - } - catch (ArithmeticException exc) - { - throw new ExpressionException(e, t, "Your math is wrong, "+exc.getMessage()); - } - catch (Expression.ExitStatement exit) - { - throw exit; - } - catch (Exception exc) - { - throw new ExpressionException(e, t, "Error while evaluating expression: "+exc.getMessage()); + throw Expression.handleCodeException(exc, e, t); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 9673bf12..535fb707 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "carpet", - "version": "${version}", + "version": "1.0.0", "name": "Carpet Mod in Fabric", "description": "Carpet made out of fabric",