mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-26 20:45:43 +01:00
Fixed bugs in the gamemode marshaller.
This commit is contained in:
parent
a6cfe7d0c9
commit
d8dba47c0f
@ -38,9 +38,6 @@ protected GameModeTypeFlag(String name) {
|
||||
public GameMode parseInput(FlagContext context) throws InvalidFlagFormat {
|
||||
String input = context.getUserInput();
|
||||
input = input.trim();
|
||||
if (!input.startsWith("/")) {
|
||||
input = "/" + input;
|
||||
}
|
||||
GameMode gamemode = unmarshal(input);
|
||||
if (gamemode == null) {
|
||||
throw new InvalidFlagFormat("Unknown game mode: " + input);
|
||||
@ -50,7 +47,7 @@ public GameMode parseInput(FlagContext context) throws InvalidFlagFormat {
|
||||
|
||||
@Override
|
||||
public GameMode unmarshal(@Nullable Object o) {
|
||||
return GameModes.get(String.valueOf(o));
|
||||
return GameModes.get(String.valueOf(o).toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user