public void checkSaveState() { if (this.playerCommandState || this.printSaveWarning || this.console.autosavePeriod <= 0) { return; } this.printSaveWarning = true; getLogger().log(Level.WARNING, "A manual (plugin-induced) save has been detected while server is configured to auto-save. This may affect performance.", warningState == WarningState.ON ? new Throwable() : null); }
/** * @deprecated This method is legacy and will be removed - it must be * replaced by the specially provided constructor(s). */ @Deprecated protected final void initialize(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) { if (server.getWarningState() == WarningState.OFF) { return; } getLogger().log(Level.WARNING, getClass().getName() + " is already initialized", server.getWarningState() == WarningState.DEFAULT ? null : new AuthorNagException("Explicit initialization")); }
@Override public WarningState getWarningState() { return warningState; }
@Override public WarningState getWarningState() { // TODO Auto-generated method stub throw new UnimplementedOperationException(); }
@Override public WarningState getWarningState() { // TODO Auto-generated method stub return null; }
/** * @see Server#getWarningState() */ public static WarningState getWarningState() { return server.getWarningState(); }
@Override public WarningState getWarningState() { return WarningState.DEFAULT; }
public WarningState getWarningState() { return warnState; }
public CraftServer(MinecraftServer console, PlayerList playerList) { this.console = console; this.playerList = (DedicatedPlayerList) playerList; this.playerView = Collections.unmodifiableList(Lists.transform(playerList.players, new Function<EntityPlayer, CraftPlayer>() { @Override public CraftPlayer apply(EntityPlayer player) { return player.getBukkitEntity(); } })); this.serverVersion = CraftServer.class.getPackage().getImplementationVersion(); online.value = console.getPropertyManager().getBoolean("online-mode", true); Bukkit.setServer(this); // Register all the Enchantments and PotionTypes now so we can stop new registration immediately after Enchantment.DAMAGE_ALL.getClass(); org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations(); Potion.setPotionBrewer(new CraftPotionBrewer()); MobEffectList.BLINDNESS.getClass(); PotionEffectType.stopAcceptingRegistrations(); // Ugly hack :( if (!Main.useConsole) { getLogger().info("Console input is disabled due to --noconsole command argument"); } configuration = YamlConfiguration.loadConfiguration(getConfigFile()); configuration.options().copyDefaults(true); configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); ConfigurationSection legacyAlias = null; if (!configuration.isString("aliases")) { legacyAlias = configuration.getConfigurationSection("aliases"); configuration.set("aliases", "now-in-commands.yml"); } saveConfig(); if (getCommandsConfigFile().isFile()) { legacyAlias = null; } commandsConfiguration = YamlConfiguration.loadConfiguration(getCommandsConfigFile()); commandsConfiguration.options().copyDefaults(true); commandsConfiguration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8))); saveCommandsConfig(); // Migrate aliases from old file and add previously implicit $1- to pass all arguments if (legacyAlias != null) { ConfigurationSection aliases = commandsConfiguration.createSection("aliases"); for (String key : legacyAlias.getKeys(false)) { ArrayList<String> commands = new ArrayList<String>(); if (legacyAlias.isList(key)) { for (String command : legacyAlias.getStringList(key)) { commands.add(command + " $1-"); } } else { commands.add(legacyAlias.getString(key) + " $1-"); } aliases.set(key, commands); } } saveCommandsConfig(); overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); ((SimplePluginManager) pluginManager).useTimings(configuration.getBoolean("settings.plugin-profiling")); monsterSpawn = configuration.getInt("spawn-limits.monsters"); animalSpawn = configuration.getInt("spawn-limits.animals"); waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); ambientSpawn = configuration.getInt("spawn-limits.ambient"); console.autosavePeriod = configuration.getInt("ticks-per.autosave"); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); chunkGCPeriod = configuration.getInt("chunk-gc.period-in-ticks"); chunkGCLoadThresh = configuration.getInt("chunk-gc.load-threshold"); loadIcon(); loadPlugins(); enablePlugins(PluginLoadOrder.STARTUP); }