Archiviert
13
0

Added "getViewDistance()", "getAllowNether()", "hasWhitelist()" and "getAllowFlight()". Thanks robin0van0der0v!

Dieser Commit ist enthalten in:
EvilSeph 2011-08-07 20:25:46 -04:00
Ursprung 47453c6055
Commit 831d97c8de

Datei anzeigen

@ -261,6 +261,10 @@ public final class CraftServer implements Server {
return this.getConfigInt("server-port", 25565); return this.getConfigInt("server-port", 25565);
} }
public int getViewDistance() {
return this.getConfigInt("view-distance", 10);
}
public String getIp() { public String getIp() {
return this.getConfigString("server-ip", ""); return this.getConfigString("server-ip", "");
} }
@ -273,6 +277,14 @@ public final class CraftServer implements Server {
return this.getConfigString("server-id", "unnamed"); return this.getConfigString("server-id", "unnamed");
} }
public boolean getAllowNether() {
return this.getConfigBoolean("allow-nether", true);
}
public boolean hasWhitelist() {
return this.getConfigBoolean("white-list", false);
}
// NOTE: Temporary calls through to server.properies until its replaced // NOTE: Temporary calls through to server.properies until its replaced
private String getConfigString(String variable, String defaultValue) { private String getConfigString(String variable, String defaultValue) {
return this.console.propertyManager.getString(variable, defaultValue); return this.console.propertyManager.getString(variable, defaultValue);
@ -282,6 +294,10 @@ public final class CraftServer implements Server {
return this.console.propertyManager.getInt(variable, defaultValue); return this.console.propertyManager.getInt(variable, defaultValue);
} }
private boolean getConfigBoolean(String variable, boolean defaultValue) {
return this.console.propertyManager.getBoolean(variable, defaultValue);
}
// End Temporary calls // End Temporary calls
public String getUpdateFolder() { public String getUpdateFolder() {
@ -676,6 +692,10 @@ public final class CraftServer implements Server {
return this.console.onlineMode; return this.console.onlineMode;
} }
public boolean getAllowFlight() {
return this.console.allowFlight;
}
public ChunkGenerator getGenerator(String world) { public ChunkGenerator getGenerator(String world) {
ConfigurationNode node = configuration.getNode("worlds"); ConfigurationNode node = configuration.getNode("worlds");
ChunkGenerator result = null; ChunkGenerator result = null;