--- a/net/minecraft/server/commands/WeatherCommand.java +++ b/net/minecraft/server/commands/WeatherCommand.java @@ -34,11 +34,11 @@ } private static int getDuration(CommandSourceStack source, int duration, IntProvider provider) { - return duration == -1 ? provider.sample(source.getServer().overworld().getRandom()) : duration; + return duration == -1 ? provider.sample(source.getLevel().getRandom()) : duration; // CraftBukkit - SPIGOT-7680: per-world } private static int setClear(CommandSourceStack source, int duration) { - source.getServer().overworld().setWeatherParameters(WeatherCommand.getDuration(source, duration, ServerLevel.RAIN_DELAY), 0, false, false); + source.getLevel().setWeatherParameters(WeatherCommand.getDuration(source, duration, ServerLevel.RAIN_DELAY), 0, false, false); // CraftBukkit - SPIGOT-7680: per-world source.sendSuccess(() -> { return Component.translatable("commands.weather.set.clear"); }, true); @@ -46,7 +46,7 @@ } private static int setRain(CommandSourceStack source, int duration) { - source.getServer().overworld().setWeatherParameters(0, WeatherCommand.getDuration(source, duration, ServerLevel.RAIN_DURATION), true, false); + source.getLevel().setWeatherParameters(0, WeatherCommand.getDuration(source, duration, ServerLevel.RAIN_DURATION), true, false); // CraftBukkit - SPIGOT-7680: per-world source.sendSuccess(() -> { return Component.translatable("commands.weather.set.rain"); }, true); @@ -54,7 +54,7 @@ } private static int setThunder(CommandSourceStack source, int duration) { - source.getServer().overworld().setWeatherParameters(0, WeatherCommand.getDuration(source, duration, ServerLevel.THUNDER_DURATION), true, true); + source.getLevel().setWeatherParameters(0, WeatherCommand.getDuration(source, duration, ServerLevel.THUNDER_DURATION), true, true); // CraftBukkit - SPIGOT-7680: per-world source.sendSuccess(() -> { return Component.translatable("commands.weather.set.thunder"); }, true);