mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
30e4583dbe
By: Initial Source <noreply+automated@papermc.io>
35 lines
2.1 KiB
Diff
35 lines
2.1 KiB
Diff
--- 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);
|