mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 08:08:34 +00:00
feat: allow captions in SuggestInputParseException (#2239)
- Deprecate for removal methods using string message - Fixes #2026
This commit is contained in:
@ -50,7 +50,7 @@ public class RichMaskParser extends FaweParser<Mask> {
|
||||
@Override
|
||||
public Mask parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
if (input.isEmpty()) {
|
||||
throw new SuggestInputParseException("No input provided", "", () -> Stream
|
||||
throw new SuggestInputParseException(Caption.of("fawe.error.no-input-provided"), () -> Stream
|
||||
.of("#", ",", "&")
|
||||
.map(n -> n + ":")
|
||||
.collect(Collectors.toList())
|
||||
@ -95,7 +95,6 @@ public class RichMaskParser extends FaweParser<Mask> {
|
||||
"https://intellectualsites.github.io/fastasyncworldedit-documentation/patterns/patterns"
|
||||
))
|
||||
)),
|
||||
full,
|
||||
() -> {
|
||||
if (full.length() == 1) {
|
||||
return new ArrayList<>(worldEdit.getMaskFactory().getSuggestions(""));
|
||||
@ -162,7 +161,6 @@ public class RichMaskParser extends FaweParser<Mask> {
|
||||
"https://intellectualsites.github.io/fastasyncworldedit-documentation/masks/masks"
|
||||
))
|
||||
)),
|
||||
full,
|
||||
() -> {
|
||||
if (full.length() == 1) {
|
||||
return new ArrayList<>(worldEdit.getMaskFactory().getSuggestions(""));
|
||||
|
@ -47,8 +47,7 @@ public class RichPatternParser extends FaweParser<Pattern> {
|
||||
public Pattern parseFromInput(String input, ParserContext context) throws InputParseException {
|
||||
if (input.isEmpty()) {
|
||||
throw new SuggestInputParseException(
|
||||
"No input provided",
|
||||
"",
|
||||
Caption.of("fawe.error.no-input-provided"),
|
||||
() -> Stream
|
||||
.concat(Stream.of("#", ",", "&"), BlockTypes.getNameSpaces().stream().map(n -> n + ":"))
|
||||
.collect(Collectors.toList())
|
||||
@ -88,7 +87,6 @@ public class RichPatternParser extends FaweParser<Pattern> {
|
||||
"https://intellectualsites.github.io/fastasyncworldedit-documentation/patterns/patterns"
|
||||
))
|
||||
)),
|
||||
full,
|
||||
() -> {
|
||||
if (full.length() == 1) {
|
||||
return new ArrayList<>(worldEdit.getPatternFactory().getSuggestions(""));
|
||||
|
Reference in New Issue
Block a user