Search in sources :

Example 1 with ScaleTransform

use of com.fastasyncworldedit.core.extent.transform.ScaleTransform in project FastAsyncWorldEdit by IntellectualSites.

the class ScaleTransformParser method parseFromInput.

@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
    double xScale;
    double yScale;
    double zScale;
    Extent extent;
    if (arguments.length == 1) {
        xScale = yScale = zScale = Double.parseDouble(arguments[0]);
        extent = context.requireExtent();
    } else if (arguments.length == 3 || arguments.length == 4) {
        xScale = Double.parseDouble(arguments[0]);
        yScale = Double.parseDouble(arguments[1]);
        zScale = Double.parseDouble(arguments[2]);
        extent = arguments.length == 4 ? worldEdit.getTransformFactory().parseFromInput(arguments[3], context) : context.requireExtent();
    } else {
        return null;
    }
    return new ScaleTransform(extent, xScale, yScale, zScale);
}
Also used : ResettableExtent(com.fastasyncworldedit.core.extent.ResettableExtent) Extent(com.sk89q.worldedit.extent.Extent) ScaleTransform(com.fastasyncworldedit.core.extent.transform.ScaleTransform)

Aggregations

ResettableExtent (com.fastasyncworldedit.core.extent.ResettableExtent)1 ScaleTransform (com.fastasyncworldedit.core.extent.transform.ScaleTransform)1 Extent (com.sk89q.worldedit.extent.Extent)1