From eff617b8f886d81b91d74b9b0ee9951375e73425 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Sat, 8 Feb 2025 22:10:08 +0100 Subject: [PATCH] [ci skip] Deprecate Server#setSpawnRadius (#12024) --- paper-api/src/main/java/org/bukkit/Bukkit.java | 4 ++++ paper-api/src/main/java/org/bukkit/Server.java | 4 ++++ .../java/org/bukkit/craftbukkit/CraftServer.java | 12 +----------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index 9196b1e62..9764489c0 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -1373,7 +1373,11 @@ public final class Bukkit { * Sets the radius, in blocks, around each worlds spawn point to protect. * * @param value new spawn radius, or 0 if none + * @deprecated has not functioned for a long time as the spawn radius is defined by the server.properties file. + * There is no API replacement for this method. It is generally recommended to implement "protection"-like behaviour + * via events or third-party plugin APIs. */ + @Deprecated(since = "1.21.4", forRemoval = true) public static void setSpawnRadius(int value) { server.setSpawnRadius(value); } diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 11923ef0e..fa6f9d505 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -1219,7 +1219,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * Sets the radius, in blocks, around each worlds spawn point to protect. * * @param value new spawn radius, or 0 if none + * @deprecated has not functioned for a long time as the spawn radius is defined by the server.properties file. + * There is no API replacement for this method. It is generally recommended to implement "protection"-like behaviour + * via events or third-party plugin APIs. */ + @Deprecated(since = "1.21.4", forRemoval = true) public void setSpawnRadius(int value); /** diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index d2de78996..d162c9c57 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1864,22 +1864,12 @@ public final class CraftServer implements Server { return result; } - public void removeBukkitSpawnRadius() { - this.configuration.set("settings.spawn-radius", null); - this.saveConfig(); - } - - public int getBukkitSpawnRadius() { - return this.configuration.getInt("settings.spawn-radius", -1); - } - - // Paper start @Override public net.kyori.adventure.text.Component shutdownMessage() { String msg = getShutdownMessage(); return msg != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(msg) : null; } - // Paper end + @Override @Deprecated // Paper public String getShutdownMessage() {