mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
0ebd5b0b0d
By: md_5 <git@md-5.net>
34 lines
2.3 KiB
Diff
34 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);
|