mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-09 04:30:51 +08:00
Add makeShape Expression overload for consistency.
This commit is contained in:
parent
cd9a45bd6b
commit
fa0618d9e3
@ -2070,10 +2070,23 @@ public int makeShape(final Region region, final Vector3 zero, final Vector3 unit
|
||||
* @throws MaxChangedBlocksException
|
||||
*/
|
||||
public int makeShape(final Region region, final Vector3 zero, final Vector3 unit,
|
||||
final Pattern pattern, final String expressionString, final boolean hollow, final int timeout)
|
||||
final Pattern pattern, final String expressionString, final boolean hollow, final int timeout)
|
||||
throws ExpressionException, MaxChangedBlocksException {
|
||||
final Expression expression = Expression.compile(expressionString, "x", "y", "z", "type", "data");
|
||||
expression.optimize();
|
||||
return makeShape(region, zero, unit, pattern, expression, hollow, timeout);
|
||||
}
|
||||
|
||||
public int makeShape(final Region region, final Vector3 zero, final Vector3 unit,
|
||||
final Pattern pattern, final Expression expression, final boolean hollow, final int timeout)
|
||||
throws ExpressionException, MaxChangedBlocksException {
|
||||
|
||||
expression.getSlots().getVariable("x")
|
||||
.orElseThrow(IllegalStateException::new);
|
||||
expression.getSlots().getVariable("y")
|
||||
.orElseThrow(IllegalStateException::new);
|
||||
expression.getSlots().getVariable("z")
|
||||
.orElseThrow(IllegalStateException::new);
|
||||
|
||||
final Variable typeVariable = expression.getSlots().getVariable("type")
|
||||
.orElseThrow(IllegalStateException::new);
|
||||
|
Loading…
Reference in New Issue
Block a user