2022-04-20 11:26:09 +02:00
|
|
|
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
|
2023-09-29 02:28:26 +02:00
|
|
|
index 29f0bb4d5bb1d5ef1b6bd64726ca84c25091f9e4..649256cb267bcf05ef4c15699cbf4e7e7e99b612 100644
|
2022-04-20 11:26:09 +02:00
|
|
|
--- 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
|
2022-09-20 02:28:22 +02:00
|
|
|
@@ -573,4 +574,32 @@ public class WorldCreator {
|
2022-04-20 11:26:09 +02:00
|
|
|
|
|
|
|
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
|
2022-09-20 02:28:22 +02:00
|
|
|
+ * @return This object, for chaining
|
2022-04-20 11:26:09 +02:00
|
|
|
+ */
|
2022-09-20 02:28:22 +02:00
|
|
|
+ @NotNull
|
|
|
|
+ public WorldCreator keepSpawnLoaded(@NotNull net.kyori.adventure.util.TriState keepSpawnLoaded) {
|
2022-04-20 11:26:09 +02:00
|
|
|
+ java.util.Objects.requireNonNull(keepSpawnLoaded, "keepSpawnLoaded");
|
|
|
|
+ this.keepSpawnLoaded = keepSpawnLoaded;
|
2022-09-20 02:28:22 +02:00
|
|
|
+ return this;
|
2022-04-20 11:26:09 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Paper end
|
|
|
|
}
|