Fixed bugs in the gamemode marshaller.

This commit is contained in:
Matthew Miller 2018-08-04 11:00:57 +10:00
parent a6cfe7d0c9
commit d8dba47c0f

View File

@ -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