Archiviert
13
0

Disable auto download by default

Dieser Commit ist enthalten in:
Dan Mulloy 2016-05-21 16:04:57 -04:00
Ursprung e5bc602af3
Commit 9ecbea68ca

Datei anzeigen

@ -1,500 +1,500 @@
/** /**
* ProtocolLib - Bukkit server library that allows access to the Minecraft protocol. * ProtocolLib - Bukkit server library that allows access to the Minecraft protocol.
* Copyright (C) 2012 Kristian S. Stangeland * Copyright (C) 2012 Kristian S. Stangeland
* *
* This program is free software; you can redistribute it and/or modify it under the terms of the * This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 2 of * GNU General Public License as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version. * the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along with this program; * You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA * 02111-1307 USA
*/ */
package com.comphenix.protocol; package com.comphenix.protocol;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.configuration.Configuration; import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import com.comphenix.protocol.injector.PlayerInjectHooks; import com.comphenix.protocol.injector.PlayerInjectHooks;
import com.google.common.base.Charsets; import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.io.Files; import com.google.common.io.Files;
/** /**
* Represents the configuration of ProtocolLib. * Represents the configuration of ProtocolLib.
* *
* @author Kristian * @author Kristian
*/ */
public class ProtocolConfig { public class ProtocolConfig {
private static final String LAST_UPDATE_FILE = "lastupdate"; private static final String LAST_UPDATE_FILE = "lastupdate";
private static final String SECTION_GLOBAL = "global"; private static final String SECTION_GLOBAL = "global";
private static final String SECTION_AUTOUPDATER = "auto updater"; private static final String SECTION_AUTOUPDATER = "auto updater";
private static final String METRICS_ENABLED = "metrics"; private static final String METRICS_ENABLED = "metrics";
private static final String IGNORE_VERSION_CHECK = "ignore version check"; private static final String IGNORE_VERSION_CHECK = "ignore version check";
private static final String BACKGROUND_COMPILER_ENABLED = "background compiler"; private static final String BACKGROUND_COMPILER_ENABLED = "background compiler";
private static final String DEBUG_MODE_ENABLED = "debug"; private static final String DEBUG_MODE_ENABLED = "debug";
private static final String DETAILED_ERROR = "detailed error"; private static final String DETAILED_ERROR = "detailed error";
private static final String INJECTION_METHOD = "injection method"; private static final String INJECTION_METHOD = "injection method";
private static final String SCRIPT_ENGINE_NAME = "script engine"; private static final String SCRIPT_ENGINE_NAME = "script engine";
private static final String SUPPRESSED_REPORTS = "suppressed reports"; private static final String SUPPRESSED_REPORTS = "suppressed reports";
private static final String UPDATER_NOTIFY = "notify"; private static final String UPDATER_NOTIFY = "notify";
private static final String UPDATER_DOWNLAD = "download"; private static final String UPDATER_DOWNLAD = "download";
private static final String UPDATER_DELAY = "delay"; private static final String UPDATER_DELAY = "delay";
// Defaults // Defaults
private static final long DEFAULT_UPDATER_DELAY = 43200; private static final long DEFAULT_UPDATER_DELAY = 43200;
private Plugin plugin; private Plugin plugin;
private Configuration config; private Configuration config;
private boolean loadingSections; private boolean loadingSections;
private ConfigurationSection global; private ConfigurationSection global;
private ConfigurationSection updater; private ConfigurationSection updater;
// Last update time // Last update time
private long lastUpdateTime; private long lastUpdateTime;
private boolean configChanged; private boolean configChanged;
private boolean valuesChanged; private boolean valuesChanged;
// Modifications // Modifications
private int modCount; private int modCount;
public ProtocolConfig(Plugin plugin) { public ProtocolConfig(Plugin plugin) {
this.plugin = plugin; this.plugin = plugin;
reloadConfig(); reloadConfig();
} }
/** /**
* Reload configuration file. * Reload configuration file.
*/ */
public void reloadConfig() { public void reloadConfig() {
// Reset // Reset
configChanged = false; configChanged = false;
valuesChanged = false; valuesChanged = false;
modCount++; modCount++;
this.config = plugin.getConfig(); this.config = plugin.getConfig();
this.lastUpdateTime = loadLastUpdate(); this.lastUpdateTime = loadLastUpdate();
loadSections(!loadingSections); loadSections(!loadingSections);
} }
/** /**
* Load the last update time stamp from the file system. * Load the last update time stamp from the file system.
* *
* @return Last update time stamp. * @return Last update time stamp.
*/ */
private long loadLastUpdate() { private long loadLastUpdate() {
File dataFile = getLastUpdateFile(); File dataFile = getLastUpdateFile();
if (dataFile.exists()) { if (dataFile.exists()) {
try { try {
return Long.parseLong(Files.toString(dataFile, Charsets.UTF_8)); return Long.parseLong(Files.toString(dataFile, Charsets.UTF_8));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
plugin.getLogger().warning("Cannot parse " + dataFile + " as a number."); plugin.getLogger().warning("Cannot parse " + dataFile + " as a number.");
} catch (IOException e) { } catch (IOException e) {
plugin.getLogger().warning("Cannot read " + dataFile); plugin.getLogger().warning("Cannot read " + dataFile);
} }
} }
// Default last update // Default last update
return 0; return 0;
} }
/** /**
* Store the given time stamp. * Store the given time stamp.
* *
* @param value - time stamp to store. * @param value - time stamp to store.
*/ */
private void saveLastUpdate(long value) { private void saveLastUpdate(long value) {
File dataFile = getLastUpdateFile(); File dataFile = getLastUpdateFile();
// The data folder must exist // The data folder must exist
dataFile.getParentFile().mkdirs(); dataFile.getParentFile().mkdirs();
if (dataFile.exists()) if (dataFile.exists())
dataFile.delete(); dataFile.delete();
try { try {
Files.write(Long.toString(value), dataFile, Charsets.UTF_8); Files.write(Long.toString(value), dataFile, Charsets.UTF_8);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("Cannot write " + dataFile, e); throw new RuntimeException("Cannot write " + dataFile, e);
} }
} }
/** /**
* Retrieve the file that is used to store the update time stamp. * Retrieve the file that is used to store the update time stamp.
* *
* @return File storing the update time stamp. * @return File storing the update time stamp.
*/ */
private File getLastUpdateFile() { private File getLastUpdateFile() {
return new File(plugin.getDataFolder(), LAST_UPDATE_FILE); return new File(plugin.getDataFolder(), LAST_UPDATE_FILE);
} }
/** /**
* Load data sections. * Load data sections.
* *
* @param copyDefaults - whether or not to copy configuration defaults. * @param copyDefaults - whether or not to copy configuration defaults.
*/ */
private void loadSections(boolean copyDefaults) { private void loadSections(boolean copyDefaults) {
if (config != null) { if (config != null) {
global = config.getConfigurationSection(SECTION_GLOBAL); global = config.getConfigurationSection(SECTION_GLOBAL);
} }
if (global != null) { if (global != null) {
updater = global.getConfigurationSection(SECTION_AUTOUPDATER); updater = global.getConfigurationSection(SECTION_AUTOUPDATER);
} }
// Automatically copy defaults // Automatically copy defaults
if (copyDefaults && (!getFile().exists() || global == null || updater == null)) { if (copyDefaults && (!getFile().exists() || global == null || updater == null)) {
loadingSections = true; loadingSections = true;
if (config != null) if (config != null)
config.options().copyDefaults(true); config.options().copyDefaults(true);
plugin.saveDefaultConfig(); plugin.saveDefaultConfig();
plugin.reloadConfig(); plugin.reloadConfig();
loadingSections = false; loadingSections = false;
// Inform the user // Inform the user
plugin.getLogger().info("Created default configuration."); plugin.getLogger().info("Created default configuration.");
} }
} }
/** /**
* Set a particular configuration key value pair. * Set a particular configuration key value pair.
* *
* @param section - the configuration root. * @param section - the configuration root.
* @param path - the path to the key. * @param path - the path to the key.
* @param value - the value to set. * @param value - the value to set.
*/ */
private void setConfig(ConfigurationSection section, String path, Object value) { private void setConfig(ConfigurationSection section, String path, Object value) {
configChanged = true; configChanged = true;
section.set(path, value); section.set(path, value);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private <T> T getGlobalValue(String path, T def) { private <T> T getGlobalValue(String path, T def) {
try { try {
return (T) global.get(path, def); return (T) global.get(path, def);
} catch (Throwable ex) { } catch (Throwable ex) {
return def; return def;
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private <T> T getUpdaterValue(String path, T def) { private <T> T getUpdaterValue(String path, T def) {
try { try {
return (T) updater.get(path, def); return (T) updater.get(path, def);
} catch (Throwable ex) { } catch (Throwable ex) {
return def; return def;
} }
} }
/** /**
* Retrieve a reference to the configuration file. * Retrieve a reference to the configuration file.
* *
* @return Configuration file on disk. * @return Configuration file on disk.
*/ */
public File getFile() { public File getFile() {
return new File(plugin.getDataFolder(), "config.yml"); return new File(plugin.getDataFolder(), "config.yml");
} }
/** /**
* Determine if detailed error reporting is enabled. Default FALSE. * Determine if detailed error reporting is enabled. Default FALSE.
* *
* @return TRUE if it is enabled, FALSE otherwise. * @return TRUE if it is enabled, FALSE otherwise.
*/ */
public boolean isDetailedErrorReporting() { public boolean isDetailedErrorReporting() {
return getGlobalValue(DETAILED_ERROR, false); return getGlobalValue(DETAILED_ERROR, false);
} }
/** /**
* Set whether or not detailed error reporting is enabled. * Set whether or not detailed error reporting is enabled.
* *
* @param value - TRUE if it is enabled, FALSE otherwise. * @param value - TRUE if it is enabled, FALSE otherwise.
*/ */
public void setDetailedErrorReporting(boolean value) { public void setDetailedErrorReporting(boolean value) {
global.set(DETAILED_ERROR, value); global.set(DETAILED_ERROR, value);
} }
/** /**
* Retrieve whether or not ProtocolLib should determine if a new version has been released. * Retrieve whether or not ProtocolLib should determine if a new version has been released.
* *
* @return TRUE if it should do this automatically, FALSE otherwise. * @return TRUE if it should do this automatically, FALSE otherwise.
*/ */
public boolean isAutoNotify() { public boolean isAutoNotify() {
return getUpdaterValue(UPDATER_NOTIFY, true); return getUpdaterValue(UPDATER_NOTIFY, true);
} }
/** /**
* Set whether or not ProtocolLib should determine if a new version has been released. * Set whether or not ProtocolLib should determine if a new version has been released.
* *
* @param value - TRUE to do this automatically, FALSE otherwise. * @param value - TRUE to do this automatically, FALSE otherwise.
*/ */
public void setAutoNotify(boolean value) { public void setAutoNotify(boolean value) {
setConfig(updater, UPDATER_NOTIFY, value); setConfig(updater, UPDATER_NOTIFY, value);
modCount++; modCount++;
} }
/** /**
* Retrieve whether or not ProtocolLib should automatically download the new version. * Retrieve whether or not ProtocolLib should automatically download the new version.
* *
* @return TRUE if it should, FALSE otherwise. * @return TRUE if it should, FALSE otherwise.
*/ */
public boolean isAutoDownload() { public boolean isAutoDownload() {
return updater != null && getUpdaterValue(UPDATER_DOWNLAD, true); return updater != null && getUpdaterValue(UPDATER_DOWNLAD, false);
} }
/** /**
* Set whether or not ProtocolLib should automatically download the new version. * Set whether or not ProtocolLib should automatically download the new version.
* *
* @param value - TRUE if it should. FALSE otherwise. * @param value - TRUE if it should. FALSE otherwise.
*/ */
public void setAutoDownload(boolean value) { public void setAutoDownload(boolean value) {
setConfig(updater, UPDATER_DOWNLAD, value); setConfig(updater, UPDATER_DOWNLAD, value);
modCount++; modCount++;
} }
/** /**
* Determine whether or not debug mode is enabled. * Determine whether or not debug mode is enabled.
* <p> * <p>
* This grants access to the filter command. * This grants access to the filter command.
* *
* @return TRUE if it is, FALSE otherwise. * @return TRUE if it is, FALSE otherwise.
*/ */
public boolean isDebug() { public boolean isDebug() {
return getGlobalValue(DEBUG_MODE_ENABLED, false); return getGlobalValue(DEBUG_MODE_ENABLED, false);
} }
/** /**
* Set whether or not debug mode is enabled. * Set whether or not debug mode is enabled.
* *
* @param value - TRUE if it is enabled, FALSE otherwise. * @param value - TRUE if it is enabled, FALSE otherwise.
*/ */
public void setDebug(boolean value) { public void setDebug(boolean value) {
setConfig(global, DEBUG_MODE_ENABLED, value); setConfig(global, DEBUG_MODE_ENABLED, value);
modCount++; modCount++;
} }
/** /**
* Retrieve an immutable list of every suppressed report type. * Retrieve an immutable list of every suppressed report type.
* *
* @return Every suppressed report type. * @return Every suppressed report type.
*/ */
public ImmutableList<String> getSuppressedReports() { public ImmutableList<String> getSuppressedReports() {
return ImmutableList.copyOf(getGlobalValue(SUPPRESSED_REPORTS, new ArrayList<String>())); return ImmutableList.copyOf(getGlobalValue(SUPPRESSED_REPORTS, new ArrayList<String>()));
} }
/** /**
* Set the list of suppressed report types, * Set the list of suppressed report types,
* *
* @param reports - suppressed report types. * @param reports - suppressed report types.
*/ */
public void setSuppressedReports(List<String> reports) { public void setSuppressedReports(List<String> reports) {
global.set(SUPPRESSED_REPORTS, Lists.newArrayList(reports)); global.set(SUPPRESSED_REPORTS, Lists.newArrayList(reports));
modCount++; modCount++;
} }
/** /**
* Retrieve the amount of time to wait until checking for a new update. * Retrieve the amount of time to wait until checking for a new update.
* *
* @return The amount of time to wait. * @return The amount of time to wait.
*/ */
public long getAutoDelay() { public long getAutoDelay() {
// Note that the delay must be greater than 59 seconds // Note that the delay must be greater than 59 seconds
return Math.max(getUpdaterValue(UPDATER_DELAY, 0), DEFAULT_UPDATER_DELAY); return Math.max(getUpdaterValue(UPDATER_DELAY, 0), DEFAULT_UPDATER_DELAY);
} }
/** /**
* Set the amount of time to wait until checking for a new update. * Set the amount of time to wait until checking for a new update.
* <p> * <p>
* This time must be greater than 59 seconds. * This time must be greater than 59 seconds.
* *
* @param delaySeconds - the amount of time to wait. * @param delaySeconds - the amount of time to wait.
*/ */
public void setAutoDelay(long delaySeconds) { public void setAutoDelay(long delaySeconds) {
// Silently fix the delay // Silently fix the delay
if (delaySeconds < DEFAULT_UPDATER_DELAY) if (delaySeconds < DEFAULT_UPDATER_DELAY)
delaySeconds = DEFAULT_UPDATER_DELAY; delaySeconds = DEFAULT_UPDATER_DELAY;
setConfig(updater, UPDATER_DELAY, delaySeconds); setConfig(updater, UPDATER_DELAY, delaySeconds);
modCount++; modCount++;
} }
/** /**
* The version of Minecraft to ignore the built-in safety feature. * The version of Minecraft to ignore the built-in safety feature.
* *
* @return The version to ignore ProtocolLib's satefy. * @return The version to ignore ProtocolLib's satefy.
*/ */
public String getIgnoreVersionCheck() { public String getIgnoreVersionCheck() {
return getGlobalValue(IGNORE_VERSION_CHECK, ""); return getGlobalValue(IGNORE_VERSION_CHECK, "");
} }
/** /**
* Sets under which version of Minecraft the version safety feature will be ignored. * Sets under which version of Minecraft the version safety feature will be ignored.
* <p> * <p>
* This is useful if a server operator has tested and verified that a version of ProtocolLib works, but doesn't want or can't upgrade to a newer version. * This is useful if a server operator has tested and verified that a version of ProtocolLib works, but doesn't want or can't upgrade to a newer version.
* *
* @param ignoreVersion - the version of Minecraft where the satefy will be disabled. * @param ignoreVersion - the version of Minecraft where the satefy will be disabled.
*/ */
public void setIgnoreVersionCheck(String ignoreVersion) { public void setIgnoreVersionCheck(String ignoreVersion) {
setConfig(global, IGNORE_VERSION_CHECK, ignoreVersion); setConfig(global, IGNORE_VERSION_CHECK, ignoreVersion);
modCount++; modCount++;
} }
/** /**
* Retrieve whether or not metrics is enabled. * Retrieve whether or not metrics is enabled.
* *
* @return TRUE if metrics is enabled, FALSE otherwise. * @return TRUE if metrics is enabled, FALSE otherwise.
*/ */
public boolean isMetricsEnabled() { public boolean isMetricsEnabled() {
return getGlobalValue(METRICS_ENABLED, true); return getGlobalValue(METRICS_ENABLED, true);
} }
/** /**
* Set whether or not metrics is enabled. * Set whether or not metrics is enabled.
* <p> * <p>
* This setting will take effect next time ProtocolLib is started. * This setting will take effect next time ProtocolLib is started.
* *
* @param enabled - whether or not metrics is enabled. * @param enabled - whether or not metrics is enabled.
*/ */
public void setMetricsEnabled(boolean enabled) { public void setMetricsEnabled(boolean enabled) {
setConfig(global, METRICS_ENABLED, enabled); setConfig(global, METRICS_ENABLED, enabled);
modCount++; modCount++;
} }
/** /**
* Retrieve whether or not the background compiler for structure modifiers is enabled or not. * Retrieve whether or not the background compiler for structure modifiers is enabled or not.
* *
* @return TRUE if it is enabled, FALSE otherwise. * @return TRUE if it is enabled, FALSE otherwise.
*/ */
public boolean isBackgroundCompilerEnabled() { public boolean isBackgroundCompilerEnabled() {
return getGlobalValue(BACKGROUND_COMPILER_ENABLED, true); return getGlobalValue(BACKGROUND_COMPILER_ENABLED, true);
} }
/** /**
* Set whether or not the background compiler for structure modifiers is enabled or not. * Set whether or not the background compiler for structure modifiers is enabled or not.
* <p> * <p>
* This setting will take effect next time ProtocolLib is started. * This setting will take effect next time ProtocolLib is started.
* *
* @param enabled - TRUE if is enabled/running, FALSE otherwise. * @param enabled - TRUE if is enabled/running, FALSE otherwise.
*/ */
public void setBackgroundCompilerEnabled(boolean enabled) { public void setBackgroundCompilerEnabled(boolean enabled) {
setConfig(global, BACKGROUND_COMPILER_ENABLED, enabled); setConfig(global, BACKGROUND_COMPILER_ENABLED, enabled);
modCount++; modCount++;
} }
/** /**
* Retrieve the last time we updated, in seconds since 1970.01.01 00:00. * Retrieve the last time we updated, in seconds since 1970.01.01 00:00.
* *
* @return Last update time. * @return Last update time.
*/ */
public long getAutoLastTime() { public long getAutoLastTime() {
return lastUpdateTime; return lastUpdateTime;
} }
/** /**
* Set the last time we updated, in seconds since 1970.01.01 00:00. * Set the last time we updated, in seconds since 1970.01.01 00:00.
* <p> * <p>
* Note that this is not considered to modify the configuration, so the modification count will not be incremented. * Note that this is not considered to modify the configuration, so the modification count will not be incremented.
* *
* @param lastTimeSeconds - new last update time. * @param lastTimeSeconds - new last update time.
*/ */
public void setAutoLastTime(long lastTimeSeconds) { public void setAutoLastTime(long lastTimeSeconds) {
this.valuesChanged = true; this.valuesChanged = true;
this.lastUpdateTime = lastTimeSeconds; this.lastUpdateTime = lastTimeSeconds;
} }
/** /**
* Retrieve the unique name of the script engine to use for filtering. * Retrieve the unique name of the script engine to use for filtering.
* *
* @return Script engine to use. * @return Script engine to use.
*/ */
public String getScriptEngineName() { public String getScriptEngineName() {
return getGlobalValue(SCRIPT_ENGINE_NAME, "JavaScript"); return getGlobalValue(SCRIPT_ENGINE_NAME, "JavaScript");
} }
/** /**
* Set the unique name of the script engine to use for filtering. * Set the unique name of the script engine to use for filtering.
* <p> * <p>
* This setting will take effect next time ProtocolLib is started. * This setting will take effect next time ProtocolLib is started.
* *
* @param name - name of the script engine to use. * @param name - name of the script engine to use.
*/ */
public void setScriptEngineName(String name) { public void setScriptEngineName(String name) {
setConfig(global, SCRIPT_ENGINE_NAME, name); setConfig(global, SCRIPT_ENGINE_NAME, name);
modCount++; modCount++;
} }
/** /**
* Retrieve the default injection method. * Retrieve the default injection method.
* *
* @return Default method. * @return Default method.
*/ */
public PlayerInjectHooks getDefaultMethod() { public PlayerInjectHooks getDefaultMethod() {
return PlayerInjectHooks.NETWORK_SERVER_OBJECT; return PlayerInjectHooks.NETWORK_SERVER_OBJECT;
} }
/** /**
* Retrieve the injection method that has been set in the configuration, or use a default value. * Retrieve the injection method that has been set in the configuration, or use a default value.
* *
* @return Injection method to use. * @return Injection method to use.
* @throws IllegalArgumentException If the configuration option is malformed. * @throws IllegalArgumentException If the configuration option is malformed.
*/ */
public PlayerInjectHooks getInjectionMethod() throws IllegalArgumentException { public PlayerInjectHooks getInjectionMethod() throws IllegalArgumentException {
String text = global.getString(INJECTION_METHOD); String text = global.getString(INJECTION_METHOD);
// Default hook if nothing has been set // Default hook if nothing has been set
PlayerInjectHooks hook = getDefaultMethod(); PlayerInjectHooks hook = getDefaultMethod();
if (text != null) if (text != null)
hook = PlayerInjectHooks.valueOf(text.toUpperCase().replace(" ", "_")); hook = PlayerInjectHooks.valueOf(text.toUpperCase().replace(" ", "_"));
return hook; return hook;
} }
/** /**
* Set the starting injection method to use. * Set the starting injection method to use.
* *
* @return Injection method. * @return Injection method.
*/ */
public void setInjectionMethod(PlayerInjectHooks hook) { public void setInjectionMethod(PlayerInjectHooks hook) {
setConfig(global, INJECTION_METHOD, hook.name()); setConfig(global, INJECTION_METHOD, hook.name());
modCount++; modCount++;
} }
/** /**
* Retrieve the number of modifications made to this configuration. * Retrieve the number of modifications made to this configuration.
* *
* @return The number of modifications. * @return The number of modifications.
*/ */
public int getModificationCount() { public int getModificationCount() {
return modCount; return modCount;
} }
/** /**
* Save the current configuration file. * Save the current configuration file.
*/ */
public void saveAll() { public void saveAll() {
if (valuesChanged) if (valuesChanged)
saveLastUpdate(lastUpdateTime); saveLastUpdate(lastUpdateTime);
if (configChanged) if (configChanged)
plugin.saveConfig(); plugin.saveConfig();
// And we're done // And we're done
valuesChanged = false; valuesChanged = false;
configChanged = false; configChanged = false;
} }
} }