Skip to content

Commit

Permalink
fix: only change weather on the overworld
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed May 9, 2024
1 parent 077f473 commit 528302e
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ public static void register(CommandDispatcher<CommandSourceStack> dispatcher, Co
dispatcher.register(Commands.literal("toggledownfall")
.requires(cs -> cs.hasPermission(Commands.LEVEL_GAMEMASTERS))
.executes(c -> {
ServerLevel level = c.getSource()
.getPlayerOrException()
.serverLevel();
ServerLevel overworld = c.getSource().getServer().overworld();

if (level.isRaining() || level.isThundering()) {
level.setWeatherParameters(6000, 0, false, false);
if (overworld.isRaining() || overworld.isThundering()) {
overworld.setWeatherParameters(6000, 0, false, false);
} else {
level.setWeatherParameters(0, 6000, true, false);
overworld.setWeatherParameters(0, 6000, true, false);
}

return 1;
Expand Down

0 comments on commit 528302e

Please sign in to comment.