geforkt von Mirrors/Paper
31 Zeilen
1.9 KiB
Diff
31 Zeilen
1.9 KiB
Diff
--- a/net/minecraft/server/commands/WeatherCommand.java
|
|
+++ b/net/minecraft/server/commands/WeatherCommand.java
|
|
@@ -44,23 +_,23 @@
|
|
}
|
|
|
|
private static int getDuration(CommandSourceStack source, int time, IntProvider timeProvider) {
|
|
- return time == -1 ? timeProvider.sample(source.getServer().overworld().getRandom()) : time;
|
|
+ return time == -1 ? timeProvider.sample(source.getLevel().getRandom()) : time; // CraftBukkit - SPIGOT-7680: per-world
|
|
}
|
|
|
|
private static int setClear(CommandSourceStack source, int time) {
|
|
- source.getServer().overworld().setWeatherParameters(getDuration(source, time, ServerLevel.RAIN_DELAY), 0, false, false);
|
|
+ source.getLevel().setWeatherParameters(getDuration(source, time, ServerLevel.RAIN_DELAY), 0, false, false); // CraftBukkit - SPIGOT-7680: per-world
|
|
source.sendSuccess(() -> Component.translatable("commands.weather.set.clear"), true);
|
|
return time;
|
|
}
|
|
|
|
private static int setRain(CommandSourceStack source, int time) {
|
|
- source.getServer().overworld().setWeatherParameters(0, getDuration(source, time, ServerLevel.RAIN_DURATION), true, false);
|
|
+ source.getLevel().setWeatherParameters(0, getDuration(source, time, ServerLevel.RAIN_DURATION), true, false); // CraftBukkit - SPIGOT-7680: per-world
|
|
source.sendSuccess(() -> Component.translatable("commands.weather.set.rain"), true);
|
|
return time;
|
|
}
|
|
|
|
private static int setThunder(CommandSourceStack source, int time) {
|
|
- source.getServer().overworld().setWeatherParameters(0, getDuration(source, time, ServerLevel.THUNDER_DURATION), true, true);
|
|
+ source.getLevel().setWeatherParameters(0, getDuration(source, time, ServerLevel.THUNDER_DURATION), true, true); // CraftBukkit - SPIGOT-7680: per-world
|
|
source.sendSuccess(() -> Component.translatable("commands.weather.set.thunder"), true);
|
|
return time;
|
|
}
|