✨ Add an adventure text colour parser
This commit is contained in:
parent
edc5249244
commit
366c4f2ce5
4 changed files with 251 additions and 50 deletions
|
|
@ -76,6 +76,10 @@ public class SimpleCaptionRegistry<C> implements FactoryDelegatingCaptionRegistr
|
|||
* Default caption for {@link StandardCaptionKeys#ARGUMENT_PARSE_FAILURE_FLAG_MISSING_ARGUMENT}
|
||||
*/
|
||||
public static final String ARGUMENT_PARSE_FAILURE_FLAG_MISSING_ARGUMENT = "Missing argument for '{flag}'";
|
||||
/**
|
||||
* Default caption for {@link StandardCaptionKeys#ARGUMENT_PARSE_FAILURE_COLOR}
|
||||
*/
|
||||
public static final String ARGUMENT_PARSE_FAILURE_COLOR = "'{input}' is not a valid color";
|
||||
|
||||
private final Map<Caption, BiFunction<Caption, C, String>> messageFactories = new HashMap<>();
|
||||
|
||||
|
|
@ -120,6 +124,10 @@ public class SimpleCaptionRegistry<C> implements FactoryDelegatingCaptionRegistr
|
|||
StandardCaptionKeys.ARGUMENT_PARSE_FAILURE_FLAG_MISSING_ARGUMENT,
|
||||
(caption, sender) -> ARGUMENT_PARSE_FAILURE_FLAG_MISSING_ARGUMENT
|
||||
);
|
||||
this.registerMessageFactory(
|
||||
StandardCaptionKeys.ARGUMENT_PARSE_FAILURE_COLOR,
|
||||
(caption, sender) -> ARGUMENT_PARSE_FAILURE_COLOR
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -80,6 +80,10 @@ public final class StandardCaptionKeys {
|
|||
* Variables: {flag}
|
||||
*/
|
||||
public static final Caption ARGUMENT_PARSE_FAILURE_FLAG_MISSING_ARGUMENT = of("argument.parse.failure.flag.missing_argument");
|
||||
/**
|
||||
* Variables: {input}
|
||||
*/
|
||||
public static final Caption ARGUMENT_PARSE_FAILURE_COLOR = of("argument.parse.failure.color");
|
||||
|
||||
private StandardCaptionKeys() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue