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

Replace usages and overrides of deprecated getSuggestions method (#2891)

Dieser Commit ist enthalten in:
Hannes Greule 2024-09-10 10:39:41 +02:00 committet von GitHub
Ursprung 9cf79d0e3b
Commit 5ac4d2fd5f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
39 geänderte Dateien mit 67 neuen und 66 gelöschten Zeilen

Datei anzeigen

@ -19,9 +19,9 @@ public class AdjacentMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
return worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
} else if (index == 1 || index == 2) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
}

Datei anzeigen

@ -22,7 +22,7 @@ public class AngleMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0 || index == 1) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
} else if (index > 1 && index <= 1 + flags.length) {

Datei anzeigen

@ -18,9 +18,9 @@ public class BesideMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(final String argumentInput, final int index) {
protected Stream<String> getSuggestions(final String argumentInput, final int index, ParserContext context) {
if (index == 0) {
return worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
return worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
} else if (index == 1 || index == 2) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
}

Datei anzeigen

@ -22,7 +22,7 @@ public class ExtremaMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0 || index == 1) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
} else if (index > 1 && index <= 1 + flags.length) {

Datei anzeigen

@ -22,7 +22,7 @@ public class ROCAngleMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0 || index == 1) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
} else if (index > 1 && index <= 1 + flags.length) {

Datei anzeigen

@ -18,7 +18,7 @@ public class RadiusMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0 || index == 1) {
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
}

Datei anzeigen

@ -24,12 +24,12 @@ public class RichOffsetMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index < 3) {
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
}
if (index == 3) {
return worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
return worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -20,7 +20,7 @@ public class SimplexMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index < 3) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
}

Datei anzeigen

@ -23,7 +23,7 @@ public class SurfaceAngleMaskParser extends RichParser<Mask> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index <= 2) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
}

Datei anzeigen

@ -25,7 +25,7 @@ public class AngleColorPatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index != 0) {
return Stream.empty();
}

Datei anzeigen

@ -25,7 +25,7 @@ public class AverageColorPatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index > 4) {
return Stream.empty();
}

Datei anzeigen

@ -54,7 +54,7 @@ public class BiomePatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return BiomeType.REGISTRY.getSuggestions(argumentInput);
}

Datei anzeigen

@ -26,9 +26,9 @@ public class BufferedPattern2DParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -26,9 +26,9 @@ public class BufferedPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -26,7 +26,7 @@ public class ColorPatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index > 4) {
return Stream.empty();
}

Datei anzeigen

@ -25,7 +25,7 @@ public class DesaturatePatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
}

Datei anzeigen

@ -28,9 +28,9 @@ public class Linear2DPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
case 1, 2 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
default -> Stream.empty();
};

Datei anzeigen

@ -28,9 +28,9 @@ public class Linear3DPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
default -> Stream.empty();
};

Datei anzeigen

@ -28,9 +28,9 @@ public class LinearPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
default -> Stream.empty();
};

Datei anzeigen

@ -25,10 +25,10 @@ public class MaskedPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
case 1, 2 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
case 1, 2 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
default -> Stream.empty();
};
}

Datei anzeigen

@ -24,9 +24,9 @@ public class NoXPatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -24,9 +24,9 @@ public class NoYPatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -24,9 +24,9 @@ public class NoZPatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -36,12 +36,12 @@ public abstract class NoisePatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
}
if (index == 1) {
return worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -25,9 +25,9 @@ public class OffsetPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
default -> Stream.empty();
};

Datei anzeigen

@ -4,6 +4,7 @@ import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
import com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder;
import com.fastasyncworldedit.core.function.pattern.RandomFullClipboardPattern;
import com.google.common.base.Function;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper;
import com.sk89q.worldedit.extension.input.InputParseException;
@ -33,7 +34,7 @@ public class RandomFullClipboardPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
switch (index) {
case 0:
if (argumentInput.equals("#") || argumentInput.equals("#c")) {

Datei anzeigen

@ -25,9 +25,9 @@ public class RandomOffsetPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
default -> Stream.empty();
};

Datei anzeigen

@ -24,9 +24,9 @@ public class RelativePatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -25,7 +25,7 @@ public class SaturatePatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index > 3) {
return Stream.empty();
}

Datei anzeigen

@ -25,9 +25,9 @@ public class SolidRandomOffsetPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
default -> Stream.empty();
};

Datei anzeigen

@ -25,9 +25,9 @@ public class SurfaceRandomOffsetPatternParser extends RichParser<Pattern> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
return switch (index) {
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
case 0 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
case 1 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
default -> Stream.empty();
};

Datei anzeigen

@ -28,7 +28,7 @@ public class TypeSwapPatternParser extends RichParser<Pattern> {
}
@Override
public Stream<String> getSuggestions(String argumentInput, int index) {
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index > 2) {
return Stream.empty();
}

Datei anzeigen

@ -23,9 +23,9 @@ public class Linear3DTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -23,9 +23,9 @@ public class LinearTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -26,11 +26,11 @@ public class OffsetTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index < 3) {
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
} else if (index == 3) {
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -24,11 +24,11 @@ public class PatternTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index == 0) {
return worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
return worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
} else if (index == 1) {
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -25,12 +25,12 @@ public class RotateTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index < 3) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
}
if (index == 3) {
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -24,11 +24,11 @@ public class ScaleTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index < 3) {
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
} else if (index == 3) {
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}

Datei anzeigen

@ -24,11 +24,11 @@ public class SpreadTransformParser extends RichParser<ResettableExtent> {
}
@Override
protected Stream<String> getSuggestions(String argumentInput, int index) {
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
if (index < 3) {
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
} else if (index == 3) {
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
}
return Stream.empty();
}