Search in sources :

Example 1 with OffsetTransform

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

the class OffsetTransformParser method parseFromInput.

@Override
protected ResettableExtent parseFromInput(@Nonnull String[] arguments, ParserContext context) throws InputParseException {
    if (arguments.length != 3 && arguments.length != 4) {
        throw new InputParseException(Caption.of("fawe.error.command.syntax", TextComponent.of("#offset[x][y][z]")));
    }
    int xOffset = Integer.parseInt(arguments[0]);
    int yOffset = Integer.parseInt(arguments[1]);
    int zOffset = Integer.parseInt(arguments[2]);
    Extent extent;
    extent = arguments.length == 4 ? worldEdit.getTransformFactory().parseFromInput(arguments[3], context) : context.requireExtent();
    return new OffsetTransform(extent, xOffset, yOffset, zOffset);
}
Also used : OffsetTransform(com.fastasyncworldedit.core.extent.transform.OffsetTransform) InputParseException(com.sk89q.worldedit.extension.input.InputParseException) ResettableExtent(com.fastasyncworldedit.core.extent.ResettableExtent) Extent(com.sk89q.worldedit.extent.Extent)

Aggregations

ResettableExtent (com.fastasyncworldedit.core.extent.ResettableExtent)1 OffsetTransform (com.fastasyncworldedit.core.extent.transform.OffsetTransform)1 InputParseException (com.sk89q.worldedit.extension.input.InputParseException)1 Extent (com.sk89q.worldedit.extent.Extent)1