3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-27 11:20:04 +01:00

Fix parseFromInput Method for Masks and Patterns When Called via API (#2839)

Explicitly Mask or Pattern in parseFromInput
Dieser Commit ist enthalten in:
Zeranny 2024-07-21 08:48:57 +01:00 committet von GitHub
Ursprung 2e1a8f9665
Commit d2033d49ca
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 15 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -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()) {

Datei anzeigen

@ -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()) {