summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/DedicatedServer.java7
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java11
2 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 5121cd61..0c748614 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -157,10 +157,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
// CraftBukkit start
- if (this.propertyManager.properties.containsKey("spawn-protection")) {
- log.info("'spawn-protection' in server.properties has been moved to 'settings.spawn-radius' in bukkit.yml. I will move your config for you.");
- this.server.setSpawnRadius(this.propertyManager.getInt("spawn-protection", 16));
+ if (this.server.getBukkitSpawnRadius() > -1) {
+ log.info("'settings.spawn-radius' in bukkit.yml has been moved to 'spawn-protection' in server.properties. I will move your config for you.");
this.propertyManager.properties.remove("spawn-protection");
+ this.propertyManager.getInt("spawn-protection", this.server.getBukkitSpawnRadius());
+ this.server.removeBukkitSpawnRadius();
this.propertyManager.savePropertiesFile();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 24b20f12..2cd7d0d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -920,8 +920,17 @@ public final class CraftServer implements Server {
return result;
}
+ public void removeBukkitSpawnRadius() {
+ configuration.set("settings.spawn-radius", null);
+ saveConfig();
+ }
+
+ public int getBukkitSpawnRadius() {
+ return configuration.getInt("settings.spawn-radius", -1);
+ }
+
public int getSpawnRadius() {
- return configuration.getInt("settings.spawn-radius", 16);
+ return ((DedicatedServer) console).propertyManager.getInt("spawn-protection", 16);
}
public void setSpawnRadius(int value) {