mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-12 06:43:58 +01:00
Moved spawn-protection from server.properties into (settings.)spawn-radius in bukkit.yml
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
fd043a8342
commit
f251e14478
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user