mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paperr@41263d9 [ci skip] Update paperweight to 1.3.4 PaperMC/Paperr@3109dd8 Updated Upstream (Bukkit/CraftBukkit) (#7428) PaperMC/Paperr@17eb884 Use a CHM for StructureTemplate.Pallete cache PaperMC/Paperr@f79c0da Updated Upstream (Bukkit/CraftBukkit) PaperMC/Paperr@2121aed Rebuild patches Pufferfish Changes: pufferfish-gg/Pufferfishr@9aa81a5 Update Upstream (Paper) pufferfish-gg/Pufferfishr@809bd9f Update Upstream (Paper) pufferfish-gg/Pufferfishr@f053fd3 Update Upstream (Paper) pufferfish-gg/Pufferfishr@5bf8730 Update Upstream (Paper) pufferfish-gg/Pufferfishr@c4a780f Update Upstream (Paper) pufferfish-gg/Pufferfishr@99a590b Fix lightning pufferfish-gg/Pufferfishr@3e75ff0 Updated Upstream (Paper) pufferfish-gg/Pufferfishr@110966e Updated Upstream (Paper) pufferfish-gg/Pufferfishr@b6b58c4 Update Upstream (Paper misc-perf branch)
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 c35100c0bc1b2e57679ab8ce2ff8bc24888d06b5..79371c88f3f5a392cce7c8306a9d2772919a8863 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -1128,6 +1128,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....
|
|
@@ -1135,6 +1136,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 24f78e964f39104be5f5eb6c961a7d98bfbeb362..6ecdae838b988bd7b40dea9cbb4d17965d31d17f 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -133,6 +133,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);
|
|
@@ -155,6 +157,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;
|