aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0378-WorldCreator-keepSpawnLoaded.patch
blob: c148a391f4cc360a61e529cf343cbffd06d953d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 3 Jul 2021 21:18:41 +0100
Subject: [PATCH] WorldCreator#keepSpawnLoaded


diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java
index cbdcac688afb7c13dd7058fa522bbd2c5adc445e..dc92ce261b9e67979da3f82cb75292ff980ad87e 100644
--- a/src/main/java/org/bukkit/WorldCreator.java
+++ b/src/main/java/org/bukkit/WorldCreator.java
@@ -22,6 +22,7 @@ public class WorldCreator {
     private boolean generateStructures = true;
     private String generatorSettings = "";
     private boolean hardcore = false;
+    private net.kyori.adventure.util.TriState keepSpawnLoaded = net.kyori.adventure.util.TriState.NOT_SET; // Paper
 
     /**
      * Creates an empty WorldCreationOptions for the given world name
@@ -573,4 +574,32 @@ public class WorldCreator {
 
         return result;
     }
+
+    // Paper start
+
+    /**
+     * Returns the current intent to keep the world loaded, @see {@link WorldCreator#keepSpawnLoaded(net.kyori.adventure.util.TriState)}
+     *
+     * @return the current tristate value
+     */
+    @NotNull
+    public net.kyori.adventure.util.TriState keepSpawnLoaded() {
+        return keepSpawnLoaded;
+    }
+
+    /**
+     * Controls if a world should be kept loaded or not, default (NOT_SET) will use the servers standard
+     * configuration, otherwise, will act as an override towards this setting
+     *
+     * @param keepSpawnLoaded the new value
+     * @return This object, for chaining
+     */
+    @NotNull
+    public WorldCreator keepSpawnLoaded(@NotNull net.kyori.adventure.util.TriState keepSpawnLoaded) {
+        java.util.Objects.requireNonNull(keepSpawnLoaded, "keepSpawnLoaded");
+        this.keepSpawnLoaded = keepSpawnLoaded;
+        return this;
+    }
+
+    // Paper end
 }