mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-27 18:41:35 +01:00
Fixed weather flag
This commit is contained in:
parent
1123270a07
commit
e31fa306ab
@ -38,9 +38,6 @@ protected WeatherTypeFlag(String name) {
|
|||||||
public WeatherType parseInput(FlagContext context) throws InvalidFlagFormat {
|
public WeatherType parseInput(FlagContext context) throws InvalidFlagFormat {
|
||||||
String input = context.getUserInput();
|
String input = context.getUserInput();
|
||||||
input = input.trim();
|
input = input.trim();
|
||||||
if (!input.startsWith("/")) {
|
|
||||||
input = "/" + input;
|
|
||||||
}
|
|
||||||
WeatherType weatherType = unmarshal(input);
|
WeatherType weatherType = unmarshal(input);
|
||||||
if (weatherType == null) {
|
if (weatherType == null) {
|
||||||
throw new InvalidFlagFormat("Unknown game mode: " + input);
|
throw new InvalidFlagFormat("Unknown game mode: " + input);
|
||||||
@ -50,7 +47,7 @@ public WeatherType parseInput(FlagContext context) throws InvalidFlagFormat {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WeatherType unmarshal(@Nullable Object o) {
|
public WeatherType unmarshal(@Nullable Object o) {
|
||||||
return WeatherTypes.get(String.valueOf(o));
|
return WeatherTypes.get(String.valueOf(o).toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user