mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 03:35:51 -07:00
Moved spawn-protection from server.properties into (settings.)spawn-radius in bukkit.yml
This commit is contained in:
@@ -50,7 +50,6 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
public boolean o;
|
||||
|
||||
// CraftBukkit start
|
||||
public int spawnProtection;
|
||||
public List<WorldServer> worlds = new ArrayList<WorldServer>();
|
||||
public CraftServer server;
|
||||
public OptionSet options;
|
||||
@@ -100,7 +99,6 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
this.spawnAnimals = this.propertyManager.getBoolean("spawn-animals", true);
|
||||
this.pvpMode = this.propertyManager.getBoolean("pvp", true);
|
||||
this.o = this.propertyManager.getBoolean("allow-flight", false);
|
||||
this.spawnProtection = this.propertyManager.getInt("spawn-protection", 16); // CraftBukkit - Configurable spawn protection start
|
||||
InetAddress inetaddress = null;
|
||||
|
||||
if (s.length() > 0) {
|
||||
@@ -149,8 +147,13 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
long elapsed = System.nanoTime() - j;
|
||||
String time = String.format("%.3fs", elapsed / 10000000000.0D);
|
||||
log.info("Done (" + time + ")! For help, type \"help\" or \"?\"");
|
||||
// CraftBukkit end
|
||||
|
||||
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.");
|
||||
server.setSpawnRadius(this.propertyManager.getInt("spawn-protection", 16));
|
||||
this.propertyManager.properties.remove("spawn-protection");
|
||||
this.propertyManager.b();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -448,7 +448,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
|
||||
if (packet14blockdig.e == 0) {
|
||||
// CraftBukkit
|
||||
if (i1 < this.minecraftServer.spawnProtection && !flag) {
|
||||
if (i1 < server.getSpawnRadius() && !flag) {
|
||||
this.player.netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, worldserver));
|
||||
} else {
|
||||
// CraftBukkit - add face argument
|
||||
|
@@ -12,7 +12,7 @@ import joptsimple.OptionSet; // CraftBukkit
|
||||
public class PropertyManager {
|
||||
|
||||
public static Logger a = Logger.getLogger("Minecraft");
|
||||
private Properties properties = new Properties();
|
||||
public Properties properties = new Properties(); // Craftbukkit - priv to pub
|
||||
private File c;
|
||||
|
||||
public PropertyManager(File file1) {
|
||||
|
@@ -99,7 +99,7 @@ public class WorldServer extends World implements BlockChangeDelegate {
|
||||
}
|
||||
|
||||
// CraftBukkit - Configurable spawn protection
|
||||
return i1 > this.server.spawnProtection || this.server.serverConfigurationManager.isOp(entityhuman.name);
|
||||
return i1 > getServer().getSpawnRadius() || this.server.serverConfigurationManager.isOp(entityhuman.name);
|
||||
}
|
||||
|
||||
protected void c(Entity entity) {
|
||||
|
Reference in New Issue
Block a user