mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-01 02:17:11 +00:00
Replace usages and overrides of deprecated getSuggestions method (#2891)
This commit is contained in:
parent
9cf79d0e3b
commit
5ac4d2fd5f
@ -19,9 +19,9 @@ public class AdjacentMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
|
||||||
} else if (index == 1 || index == 2) {
|
} else if (index == 1 || index == 2) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class AngleMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0 || index == 1) {
|
if (index == 0 || index == 1) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
|
||||||
} else if (index > 1 && index <= 1 + flags.length) {
|
} else if (index > 1 && index <= 1 + flags.length) {
|
||||||
|
@ -18,9 +18,9 @@ public class BesideMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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) {
|
if (index == 0) {
|
||||||
return worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
|
||||||
} else if (index == 1 || index == 2) {
|
} else if (index == 1 || index == 2) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class ExtremaMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0 || index == 1) {
|
if (index == 0 || index == 1) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
|
||||||
} else if (index > 1 && index <= 1 + flags.length) {
|
} else if (index > 1 && index <= 1 + flags.length) {
|
||||||
|
@ -22,7 +22,7 @@ public class ROCAngleMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0 || index == 1) {
|
if (index == 0 || index == 1) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput).flatMap(s -> Stream.of(s, s + "d"));
|
||||||
} else if (index > 1 && index <= 1 + flags.length) {
|
} else if (index > 1 && index <= 1 + flags.length) {
|
||||||
|
@ -18,7 +18,7 @@ public class RadiusMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0 || index == 1) {
|
if (index == 0 || index == 1) {
|
||||||
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
}
|
}
|
||||||
|
@ -24,12 +24,12 @@ public class RichOffsetMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index < 3) {
|
if (index < 3) {
|
||||||
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
}
|
}
|
||||||
if (index == 3) {
|
if (index == 3) {
|
||||||
return worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class SimplexMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index < 3) {
|
if (index < 3) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ public class SurfaceAngleMaskParser extends RichParser<Mask> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index <= 2) {
|
if (index <= 2) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class AngleColorPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class AverageColorPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index > 4) {
|
if (index > 4) {
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class BiomePatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return BiomeType.REGISTRY.getSuggestions(argumentInput);
|
return BiomeType.REGISTRY.getSuggestions(argumentInput);
|
||||||
}
|
}
|
||||||
|
@ -26,9 +26,9 @@ public class BufferedPattern2DParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -26,9 +26,9 @@ public class BufferedPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public class ColorPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index > 4) {
|
if (index > 4) {
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class DesaturatePatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
}
|
}
|
||||||
|
@ -28,9 +28,9 @@ public class Linear2DPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
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);
|
case 1, 2 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
|
@ -28,9 +28,9 @@ public class Linear3DPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
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);
|
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
|
@ -28,9 +28,9 @@ public class LinearPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
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);
|
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
|
@ -25,10 +25,10 @@ public class MaskedPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
return switch (index) {
|
||||||
case 0 -> this.worldEdit.getMaskFactory().getSuggestions(argumentInput).stream();
|
case 0 -> this.worldEdit.getMaskFactory().getSuggestions(argumentInput, context).stream();
|
||||||
case 1, 2 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
case 1, 2 -> this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,9 @@ public class NoXPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,9 @@ public class NoYPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,9 @@ public class NoZPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,12 @@ public abstract class NoisePatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
}
|
}
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
return worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,9 @@ public class OffsetPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
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);
|
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
|
@ -4,6 +4,7 @@ import com.fastasyncworldedit.core.configuration.Caption;
|
|||||||
import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
|
import com.fastasyncworldedit.core.extension.factory.parser.RichParser;
|
||||||
import com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder;
|
import com.fastasyncworldedit.core.extent.clipboard.MultiClipboardHolder;
|
||||||
import com.fastasyncworldedit.core.function.pattern.RandomFullClipboardPattern;
|
import com.fastasyncworldedit.core.function.pattern.RandomFullClipboardPattern;
|
||||||
|
import com.google.common.base.Function;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||||
@ -33,7 +34,7 @@ public class RandomFullClipboardPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
if (argumentInput.equals("#") || argumentInput.equals("#c")) {
|
if (argumentInput.equals("#") || argumentInput.equals("#c")) {
|
||||||
|
@ -25,9 +25,9 @@ public class RandomOffsetPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
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);
|
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
|
@ -24,9 +24,9 @@ public class RelativePatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return this.worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class SaturatePatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index > 3) {
|
if (index > 3) {
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,9 @@ public class SolidRandomOffsetPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
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);
|
case 1, 2, 3 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
|
@ -25,9 +25,9 @@ public class SurfaceRandomOffsetPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
return switch (index) {
|
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);
|
case 1 -> SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
default -> Stream.empty();
|
default -> Stream.empty();
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,7 @@ public class TypeSwapPatternParser extends RichParser<Pattern> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Stream<String> getSuggestions(String argumentInput, int index) {
|
public Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index > 2) {
|
if (index > 2) {
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ public class Linear3DTransformParser extends RichParser<ResettableExtent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ public class LinearTransformParser extends RichParser<ResettableExtent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,11 @@ public class OffsetTransformParser extends RichParser<ResettableExtent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index < 3) {
|
if (index < 3) {
|
||||||
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
} else if (index == 3) {
|
} else if (index == 3) {
|
||||||
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -24,11 +24,11 @@ public class PatternTransformParser extends RichParser<ResettableExtent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return worldEdit.getPatternFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getPatternFactory().getSuggestions(argumentInput, context).stream();
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,12 @@ public class RotateTransformParser extends RichParser<ResettableExtent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index < 3) {
|
if (index < 3) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
}
|
}
|
||||||
if (index == 3) {
|
if (index == 3) {
|
||||||
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -24,11 +24,11 @@ public class ScaleTransformParser extends RichParser<ResettableExtent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index < 3) {
|
if (index < 3) {
|
||||||
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
return SuggestionHelper.suggestPositiveDoubles(argumentInput);
|
||||||
} else if (index == 3) {
|
} else if (index == 3) {
|
||||||
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
@ -24,11 +24,11 @@ public class SpreadTransformParser extends RichParser<ResettableExtent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Stream<String> getSuggestions(String argumentInput, int index) {
|
protected Stream<String> getSuggestions(String argumentInput, int index, ParserContext context) {
|
||||||
if (index < 3) {
|
if (index < 3) {
|
||||||
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
return SuggestionHelper.suggestPositiveIntegers(argumentInput);
|
||||||
} else if (index == 3) {
|
} else if (index == 3) {
|
||||||
return worldEdit.getTransformFactory().getSuggestions(argumentInput).stream();
|
return worldEdit.getTransformFactory().getSuggestions(argumentInput, context).stream();
|
||||||
}
|
}
|
||||||
return Stream.empty();
|
return Stream.empty();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user