small fixes

This commit is contained in:
gnembon committed 2019-07-21 21:28:07 -03:00
1 parent 2ba811bf48
commit ba577dcc38
4 files changed
+13 -44

No files matched your search

@@ -2254,6 +2254,11 @@ public class CarpetExpression
* which indicates how far part you would want particles to appear, so <code>0.1</code> means one every 10cm.</p>
* <h3><code>particle_rect(name, pos, pos2, density?)</code></h3>
* <p>Renders a cuboid of particles between point <code>pos</code> to <code>pos2</code> with supplied density.</p>
* <h2>Markers</h2>
* <h3><code>create_marker(text, pos, rotation?, block?)</code></h3>
* <p>Spawns a (permanent) marker entity with text or block at position. Returns that entity for further manipulations</p>
* <h3><code>remove_all_markers()</code></h3>
* <p>Removes all scarpet markers from the loaded portion of the world in case you didn't want to do the cleanup</p>
* <h2>System function</h2>
* <h3><code>nbt(expr)</code></h3>
* <p>Treats the argument as a nbt serializable string and returns its nbt value.
+1 -1
View File
@@ -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;
+6 -42
View File
@@ -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);
}
}
+1 -1
View File
@@ -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",