Search in sources :

Example 1 with RandomOffsetTransform

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

the class SpreadTransformParser method parseFromInput.

@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
    if (arguments.length != 3 && arguments.length != 4) {
        return null;
    }
    int xOffset = Integer.parseInt(arguments[0]);
    int yOffset = Integer.parseInt(arguments[1]);
    int zOffset = Integer.parseInt(arguments[2]);
    Extent extent = arguments.length == 4 ? worldEdit.getTransformFactory().parseFromInput(arguments[3], context) : context.requireExtent();
    return new RandomOffsetTransform(extent, xOffset, yOffset, zOffset);
}
Also used : ResettableExtent(com.fastasyncworldedit.core.extent.ResettableExtent) Extent(com.sk89q.worldedit.extent.Extent) RandomOffsetTransform(com.fastasyncworldedit.core.extent.transform.RandomOffsetTransform)

Aggregations

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