mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2024-11-22 04:16:17 +00:00
35 lines
2.3 KiB
Diff
35 lines
2.3 KiB
Diff
--- a/net/minecraft/server/commands/CommandWeather.java
|
|
+++ b/net/minecraft/server/commands/CommandWeather.java
|
|
@@ -34,11 +34,11 @@
|
|
}
|
|
|
|
private static int getDuration(CommandListenerWrapper commandlistenerwrapper, int i, IntProvider intprovider) {
|
|
- return i == -1 ? intprovider.sample(commandlistenerwrapper.getServer().overworld().getRandom()) : i;
|
|
+ return i == -1 ? intprovider.sample(commandlistenerwrapper.getLevel().getRandom()) : i; // CraftBukkit - SPIGOT-7680: per-world
|
|
}
|
|
|
|
private static int setClear(CommandListenerWrapper commandlistenerwrapper, int i) {
|
|
- commandlistenerwrapper.getServer().overworld().setWeatherParameters(getDuration(commandlistenerwrapper, i, WorldServer.RAIN_DELAY), 0, false, false);
|
|
+ commandlistenerwrapper.getLevel().setWeatherParameters(getDuration(commandlistenerwrapper, i, WorldServer.RAIN_DELAY), 0, false, false); // CraftBukkit - SPIGOT-7680: per-world
|
|
commandlistenerwrapper.sendSuccess(() -> {
|
|
return IChatBaseComponent.translatable("commands.weather.set.clear");
|
|
}, true);
|
|
@@ -46,7 +46,7 @@
|
|
}
|
|
|
|
private static int setRain(CommandListenerWrapper commandlistenerwrapper, int i) {
|
|
- commandlistenerwrapper.getServer().overworld().setWeatherParameters(0, getDuration(commandlistenerwrapper, i, WorldServer.RAIN_DURATION), true, false);
|
|
+ commandlistenerwrapper.getLevel().setWeatherParameters(0, getDuration(commandlistenerwrapper, i, WorldServer.RAIN_DURATION), true, false); // CraftBukkit - SPIGOT-7680: per-world
|
|
commandlistenerwrapper.sendSuccess(() -> {
|
|
return IChatBaseComponent.translatable("commands.weather.set.rain");
|
|
}, true);
|
|
@@ -54,7 +54,7 @@
|
|
}
|
|
|
|
private static int setThunder(CommandListenerWrapper commandlistenerwrapper, int i) {
|
|
- commandlistenerwrapper.getServer().overworld().setWeatherParameters(0, getDuration(commandlistenerwrapper, i, WorldServer.THUNDER_DURATION), true, true);
|
|
+ commandlistenerwrapper.getLevel().setWeatherParameters(0, getDuration(commandlistenerwrapper, i, WorldServer.THUNDER_DURATION), true, true); // CraftBukkit - SPIGOT-7680: per-world
|
|
commandlistenerwrapper.sendSuccess(() -> {
|
|
return IChatBaseComponent.translatable("commands.weather.set.thunder");
|
|
}, true);
|