mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Fix parseFromInput Method for Masks and Patterns When Called via API (#2839)
Explicitly Mask or Pattern in parseFromInput
This commit is contained in:
parent
2e1a8f9665
commit
d2033d49ca
@ -53,6 +53,7 @@ import com.sk89q.worldedit.extension.factory.parser.mask.NoiseMaskParser;
|
|||||||
import com.sk89q.worldedit.extension.factory.parser.mask.OffsetMaskParser;
|
import com.sk89q.worldedit.extension.factory.parser.mask.OffsetMaskParser;
|
||||||
import com.sk89q.worldedit.extension.factory.parser.mask.RegionMaskParser;
|
import com.sk89q.worldedit.extension.factory.parser.mask.RegionMaskParser;
|
||||||
import com.sk89q.worldedit.extension.factory.parser.mask.SolidMaskParser;
|
import com.sk89q.worldedit.extension.factory.parser.mask.SolidMaskParser;
|
||||||
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
import com.sk89q.worldedit.extension.input.NoMatchException;
|
import com.sk89q.worldedit.extension.input.NoMatchException;
|
||||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||||
import com.sk89q.worldedit.function.mask.Mask;
|
import com.sk89q.worldedit.function.mask.Mask;
|
||||||
@ -132,6 +133,11 @@ public final class MaskFactory extends AbstractFactory<Mask> {
|
|||||||
|
|
||||||
//FAWE start - rich mask parsing
|
//FAWE start - rich mask parsing
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mask parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||||
|
return super.parseFromInput(input, context);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Mask getParsed(final String input, final List<Mask> masks) {
|
protected Mask getParsed(final String input, final List<Mask> masks) {
|
||||||
return switch (masks.size()) {
|
return switch (masks.size()) {
|
||||||
|
@ -60,7 +60,9 @@ import com.sk89q.worldedit.extension.factory.parser.pattern.RandomPatternParser;
|
|||||||
import com.sk89q.worldedit.extension.factory.parser.pattern.RandomStatePatternParser;
|
import com.sk89q.worldedit.extension.factory.parser.pattern.RandomStatePatternParser;
|
||||||
import com.sk89q.worldedit.extension.factory.parser.pattern.SingleBlockPatternParser;
|
import com.sk89q.worldedit.extension.factory.parser.pattern.SingleBlockPatternParser;
|
||||||
import com.sk89q.worldedit.extension.factory.parser.pattern.TypeOrStateApplyingPatternParser;
|
import com.sk89q.worldedit.extension.factory.parser.pattern.TypeOrStateApplyingPatternParser;
|
||||||
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
import com.sk89q.worldedit.extension.input.NoMatchException;
|
import com.sk89q.worldedit.extension.input.NoMatchException;
|
||||||
|
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||||
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
import com.sk89q.worldedit.function.pattern.RandomPattern;
|
||||||
import com.sk89q.worldedit.internal.registry.AbstractFactory;
|
import com.sk89q.worldedit.internal.registry.AbstractFactory;
|
||||||
@ -130,6 +132,13 @@ public final class PatternFactory extends AbstractFactory<Pattern> {
|
|||||||
register(new VoronoiPatternParser(worldEdit));
|
register(new VoronoiPatternParser(worldEdit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//FAWE start - rich pattern parsing
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||||
|
return super.parseFromInput(input, context);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Pattern getParsed(final String input, final List<Pattern> patterns) {
|
protected Pattern getParsed(final String input, final List<Pattern> patterns) {
|
||||||
switch (patterns.size()) {
|
switch (patterns.size()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user