mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@44ee1cd fix recipe packet limiter (#9841) PaperMC/Paper@e57af7d sync netty version with vanilla (#9842) Pufferfish Changes: pufferfish-gg/Pufferfish@0020a8b Port a patch from upstream pufferfish-gg/Pufferfish@979d3a2 Update upstream (last 1.20.1) pufferfish-gg/Pufferfish@06262c1 Initial 1.20.2 update
49 lines
3.2 KiB
Diff
49 lines
3.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: 12emin34 <macanovic.emin@gmail.com>
|
|
Date: Mon, 23 Aug 2021 17:59:29 +0200
|
|
Subject: [PATCH] Option for if rain and thunder should stop on sleep
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
index f7d9398c9a73c8a02a2515b9d43b49433e5f883c..492a50f3b619753f8a353c739a3f10c44dfa7861 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -1378,6 +1378,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
private void resetWeatherCycle() {
|
|
// CraftBukkit start
|
|
+ if (this.purpurConfig.rainStopsAfterSleep) // Purpur
|
|
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - when passing the night
|
|
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
|
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
|
@@ -1385,6 +1386,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
this.serverLevelData.setRainTime(0);
|
|
}
|
|
// CraftBukkit end
|
|
+ if (this.purpurConfig.thunderStopsAfterSleep) // Purpur
|
|
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - when passing the night
|
|
// CraftBukkit start
|
|
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index a8cddd10832e6be2704569b6c1fb995bd9caf0b9..1da30e052c08c27370755cae3e1890a397a2f323 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -139,6 +139,8 @@ public class PurpurWorldConfig {
|
|
public int raidCooldownSeconds = 0;
|
|
public int animalBreedingCooldownSeconds = 0;
|
|
public boolean mobsIgnoreRails = false;
|
|
+ public boolean rainStopsAfterSleep = true;
|
|
+ public boolean thunderStopsAfterSleep = true;
|
|
private void miscGameplayMechanicsSettings() {
|
|
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
|
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
|
@@ -161,6 +163,8 @@ public class PurpurWorldConfig {
|
|
raidCooldownSeconds = getInt("gameplay-mechanics.raid-cooldown-seconds", raidCooldownSeconds);
|
|
animalBreedingCooldownSeconds = getInt("gameplay-mechanics.animal-breeding-cooldown-seconds", animalBreedingCooldownSeconds);
|
|
mobsIgnoreRails = getBoolean("gameplay-mechanics.mobs-ignore-rails", mobsIgnoreRails);
|
|
+ rainStopsAfterSleep = getBoolean("gameplay-mechanics.rain-stops-after-sleep", rainStopsAfterSleep);
|
|
+ thunderStopsAfterSleep = getBoolean("gameplay-mechanics.thunder-stops-after-sleep", thunderStopsAfterSleep);
|
|
}
|
|
|
|
public int daytimeTicks = 12000;
|