mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-17 04:41:32 +01:00
Move the lowercase unmarshalling entity code.
This commit is contained in:
parent
f19d2ee73d
commit
a6cfe7d0c9
@ -40,7 +40,7 @@ protected EntityTypeFlag(String name) {
|
|||||||
@Override
|
@Override
|
||||||
public EntityType parseInput(FlagContext context) throws InvalidFlagFormat {
|
public EntityType parseInput(FlagContext context) throws InvalidFlagFormat {
|
||||||
String input = context.getUserInput();
|
String input = context.getUserInput();
|
||||||
input = input.trim().toLowerCase();
|
input = input.trim();
|
||||||
EntityType entityType = unmarshal(input);
|
EntityType entityType = unmarshal(input);
|
||||||
if (entityType == null) {
|
if (entityType == null) {
|
||||||
throw new InvalidFlagFormat("Unknown entity type: " + input);
|
throw new InvalidFlagFormat("Unknown entity type: " + input);
|
||||||
@ -50,7 +50,7 @@ public EntityType parseInput(FlagContext context) throws InvalidFlagFormat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityType unmarshal(@Nullable Object o) {
|
public EntityType unmarshal(@Nullable Object o) {
|
||||||
return EntityTypes.get(String.valueOf(o));
|
return EntityTypes.get(String.valueOf(o).toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user