Search in sources :

Example 1 with PatternTransform

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

the class PatternTransformParser method parseFromInput.

@Override
protected ResettableExtent parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
    if (arguments.length > 2) {
        return null;
    }
    Pattern pattern = worldEdit.getPatternFactory().parseFromInput(arguments[0], context);
    Extent extent = arguments.length == 2 ? worldEdit.getTransformFactory().parseFromInput(arguments[1], context) : context.requireExtent();
    return new PatternTransform(extent, pattern);
}
Also used : Pattern(com.sk89q.worldedit.function.pattern.Pattern) ResettableExtent(com.fastasyncworldedit.core.extent.ResettableExtent) Extent(com.sk89q.worldedit.extent.Extent) PatternTransform(com.fastasyncworldedit.core.extent.transform.PatternTransform)

Aggregations

ResettableExtent (com.fastasyncworldedit.core.extent.ResettableExtent)1 PatternTransform (com.fastasyncworldedit.core.extent.transform.PatternTransform)1 Extent (com.sk89q.worldedit.extent.Extent)1 Pattern (com.sk89q.worldedit.function.pattern.Pattern)1