aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0033-Allow-for-toggling-of-spawn-chunks.patch
blob: 2aa0d85e0b9754fab59e3a1d82e70b58369801d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 3 Mar 2016 03:53:43 -0600
Subject: [PATCH] Allow for toggling of spawn chunks


diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 476b513e05a8ef099a17db44732ebc8eed8a595c..a72b84cdf2b5f4aea5eb7fe4dfc0faad27c46876 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -403,6 +403,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
             this.dragonFight = null;
         }
 
+        // Paper start - keep spawn loaded
+        if (this.paperConfig().spawn.keepSpawnLoaded && this.getGameRules().getInt(GameRules.RULE_SPAWN_CHUNK_RADIUS) == 0) {
+            this.getGameRules().getRule(GameRules.RULE_SPAWN_CHUNK_RADIUS).set(this.paperConfig().spawn.keepSpawnLoadedRange, this);
+        }
+        // Paper end - keep spawn loaded
+
         this.sleepStatus = new SleepStatus();
         this.gameEventDispatcher = new GameEventDispatcher(this);
         this.randomSequences = (RandomSequences) Objects.requireNonNullElseGet(randomsequences, () -> {