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 6d4232de6f..2ac7c59a1e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -95,7 +95,9 @@ public final class CraftServer implements Server { configuration.getString("database.password", "walrus"); configuration.getString("database.driver", "org.sqlite.JDBC"); configuration.getString("database.isolation", "SERIALIZABLE"); + configuration.getString("settings.update-folder", "update"); + configuration.getInt("settings.spawn-radius", 16); if (configuration.getNode("aliases") == null) { configuration.setProperty("aliases.icanhasbukkit", "version"); @@ -553,4 +555,13 @@ public final class CraftServer implements Server { return result; } + + public int getSpawnRadius() { + return configuration.getInt("settings.spawn-radius", 16); + } + + public void setSpawnRadius(int value) { + configuration.setProperty("settings.spawn-radius", value); + configuration.save(); + } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 6074d0727f..474cd3f460 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -23,6 +23,7 @@ import net.minecraft.server.Item; import net.minecraft.server.ItemStack; import net.minecraft.server.World; import net.minecraft.server.WorldServer; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Block; @@ -50,7 +51,7 @@ import org.bukkit.event.player.PlayerInteractEvent; public class CraftEventFactory { private static boolean canBuild(CraftWorld world, Player player, int x, int z) { WorldServer worldServer = world.getHandle(); - int spawnSize = worldServer.server.spawnProtection; + int spawnSize = Bukkit.getServer().getSpawnRadius(); if (spawnSize <= 0) return true; if (player.isOp()) return true;