Implement new deprecated warning state configuration option

This commit is contained in:
Wesley Wolfe 2012-08-06 23:52:49 -05:00
parent bfbdbbd05c
commit 2bb7a5f94d
2 changed files with 9 additions and 1 deletions

View File

@ -53,6 +53,7 @@ import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.Warning.WarningState;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.World.Environment; import org.bukkit.World.Environment;
import org.bukkit.WorldCreator; import org.bukkit.WorldCreator;
@ -110,7 +111,6 @@ import org.bukkit.plugin.messaging.Messenger;
import org.bukkit.potion.Potion; import org.bukkit.potion.Potion;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import org.bukkit.plugin.messaging.StandardMessenger; import org.bukkit.plugin.messaging.StandardMessenger;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scheduler.BukkitWorker; import org.bukkit.scheduler.BukkitWorker;
import org.bukkit.util.permissions.DefaultPermissions; import org.bukkit.util.permissions.DefaultPermissions;
@ -152,6 +152,7 @@ public final class CraftServer implements Server {
private int animalSpawn = -1; private int animalSpawn = -1;
private int waterAnimalSpawn = -1; private int waterAnimalSpawn = -1;
private File container; private File container;
private WarningState warningState = WarningState.DEFAULT;
static { static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
@ -185,6 +186,7 @@ public final class CraftServer implements Server {
monsterSpawn = configuration.getInt("spawn-limits.monsters"); monsterSpawn = configuration.getInt("spawn-limits.monsters");
animalSpawn = configuration.getInt("spawn-limits.animals"); animalSpawn = configuration.getInt("spawn-limits.animals");
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
updater = new AutoUpdater(new BukkitDLUpdaterService(configuration.getString("auto-updater.host")), getLogger(), configuration.getString("auto-updater.preferred-channel")); updater = new AutoUpdater(new BukkitDLUpdaterService(configuration.getString("auto-updater.host")), getLogger(), configuration.getString("auto-updater.preferred-channel"));
updater.setEnabled(configuration.getBoolean("auto-updater.enabled")); updater.setEnabled(configuration.getBoolean("auto-updater.enabled"));
@ -514,6 +516,7 @@ public final class CraftServer implements Server {
monsterSpawn = configuration.getInt("spawn-limits.monsters"); monsterSpawn = configuration.getInt("spawn-limits.monsters");
animalSpawn = configuration.getInt("spawn-limits.animals"); animalSpawn = configuration.getInt("spawn-limits.animals");
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
for (WorldServer world : console.worlds) { for (WorldServer world : console.worlds) {
world.difficulty = difficulty; world.difficulty = difficulty;
@ -1220,4 +1223,8 @@ public final class CraftServer implements Server {
public String getMotd() { public String getMotd() {
return console.getMotd(); return console.getMotd();
} }
public WarningState getWarningState() {
return warningState;
}
} }

View File

@ -24,6 +24,7 @@ settings:
plugin-profiling: false plugin-profiling: false
connection-throttle: 4000 connection-throttle: 4000
query-plugins: true query-plugins: true
deprecated-verbose: default
spawn-limits: spawn-limits:
monsters: 70 monsters: 70
animals: 15 animals: 15