diff --git a/plugin/src/main/java/com/alttd/essentia/commands/admin/PlayerWeatherCommand.java b/plugin/src/main/java/com/alttd/essentia/commands/admin/PlayerWeatherCommand.java index d367b90..0e13931 100644 --- a/plugin/src/main/java/com/alttd/essentia/commands/admin/PlayerWeatherCommand.java +++ b/plugin/src/main/java/com/alttd/essentia/commands/admin/PlayerWeatherCommand.java @@ -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 aliases() { return List.of("pweather"); }