Add reset option to pweather
This commit is contained in:
parent
29559b83c4
commit
a8221a68af
|
|
@ -29,7 +29,16 @@ public class PlayerWeatherCommand implements EssentiaCommand {
|
|||
Commands.literal(commandName)
|
||||
.requires(
|
||||
commandSourceStack -> commandSourceStack.getSender().hasPermission("essentia.command.admin." + commandName) &&
|
||||
commandSourceStack.getSender() instanceof Player
|
||||
commandSourceStack.getSender() instanceof Player
|
||||
)
|
||||
.then(
|
||||
Commands.literal("reset")
|
||||
.executes(commandContext -> {
|
||||
if (commandContext.getSource().getSender() instanceof Player player)
|
||||
resetWeather(player);
|
||||
|
||||
return 1;
|
||||
})
|
||||
)
|
||||
.then(
|
||||
Commands.argument("weather", new WeatherArgument())
|
||||
|
|
@ -60,6 +69,10 @@ public class PlayerWeatherCommand implements EssentiaCommand {
|
|||
target.setPlayerWeather(weatherType);
|
||||
}
|
||||
|
||||
void resetWeather(Player player) {
|
||||
player.resetPlayerWeather();
|
||||
}
|
||||
|
||||
public List<String> aliases() {
|
||||
return List.of("pweather");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user