Fixed weather flag

This commit is contained in:
Matthew Miller 2018-08-10 18:55:32 +10:00
parent 1123270a07
commit e31fa306ab

View File

@ -38,9 +38,6 @@ protected WeatherTypeFlag(String name) {
public WeatherType parseInput(FlagContext context) throws InvalidFlagFormat {
String input = context.getUserInput();
input = input.trim();
if (!input.startsWith("/")) {
input = "/" + input;
}
WeatherType weatherType = unmarshal(input);
if (weatherType == null) {
throw new InvalidFlagFormat("Unknown game mode: " + input);
@ -50,7 +47,7 @@ public WeatherType parseInput(FlagContext context) throws InvalidFlagFormat {
@Override
public WeatherType unmarshal(@Nullable Object o) {
return WeatherTypes.get(String.valueOf(o));
return WeatherTypes.get(String.valueOf(o).toLowerCase());
}
@Override