2013-01-18 21:51:08 +00:00
|
|
|
package de.jaschastarke.minecraft.limitedcreative;
|
|
|
|
|
|
|
|
import de.jaschastarke.bukkit.lib.Core;
|
2013-09-25 21:52:43 +00:00
|
|
|
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
|
2013-01-18 21:51:08 +00:00
|
|
|
import de.jaschastarke.bukkit.lib.configuration.PluginConfiguration;
|
2013-03-23 16:59:14 +00:00
|
|
|
import de.jaschastarke.configuration.IConfigurationNode;
|
|
|
|
import de.jaschastarke.configuration.InvalidValueException;
|
2013-01-20 12:15:34 +00:00
|
|
|
import de.jaschastarke.configuration.annotations.IsConfigurationNode;
|
2013-01-18 21:51:08 +00:00
|
|
|
import de.jaschastarke.maven.ArchiveDocComments;
|
2013-09-25 21:52:43 +00:00
|
|
|
import de.jaschastarke.maven.PluginConfigurations;
|
2013-03-23 16:59:14 +00:00
|
|
|
import de.jaschastarke.modularize.IModule;
|
|
|
|
import de.jaschastarke.modularize.ModuleEntry;
|
2013-01-18 21:51:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Limited Creative - Configuration
|
|
|
|
*
|
|
|
|
* (YAML-Syntax: http://en.wikipedia.org/wiki/YAML)
|
2013-02-05 20:04:05 +00:00
|
|
|
*
|
2013-07-28 22:12:47 +00:00
|
|
|
* This configuration-file is automatically written when changed via ingame-commands. So any manual added comments are
|
2013-02-05 20:04:05 +00:00
|
|
|
* removed.
|
2013-01-18 21:51:08 +00:00
|
|
|
*/
|
|
|
|
@ArchiveDocComments
|
2013-09-25 21:52:43 +00:00
|
|
|
@PluginConfigurations
|
2013-01-18 21:51:08 +00:00
|
|
|
public class Config extends PluginConfiguration {
|
2013-09-25 21:52:43 +00:00
|
|
|
public Config(ConfigurationContainer container) {
|
|
|
|
super(container);
|
|
|
|
}
|
2013-01-18 21:51:08 +00:00
|
|
|
public Config(Core plugin) {
|
|
|
|
super(plugin);
|
|
|
|
}
|
2013-01-20 12:15:34 +00:00
|
|
|
|
2013-03-23 16:59:14 +00:00
|
|
|
@Override
|
|
|
|
public void setValue(IConfigurationNode node, Object pValue) throws InvalidValueException {
|
|
|
|
super.setValue(node, pValue);
|
|
|
|
|
|
|
|
if (node.getName().equals("metrics")) {
|
2013-10-01 14:58:01 +00:00
|
|
|
ModuleEntry<IModule> metricsEntry = plugin.getModule(FeatureMetrics.class).getModuleEntry();
|
|
|
|
metricsEntry.setEnabled(getMetrics());
|
2013-03-23 16:59:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-01 21:25:43 +00:00
|
|
|
/**
|
|
|
|
* Metrics
|
|
|
|
*
|
2013-07-28 22:12:47 +00:00
|
|
|
* This settings allows the Addon-Author to track the Servers using this plugin. It will not track any player
|
|
|
|
* related data like names, ips, online time or such. Please do not disable the option! As more servers are using
|
2013-02-01 21:25:43 +00:00
|
|
|
* the plugin and the author knows, as more he is willing to support the plugin! Its a win-win for both.
|
|
|
|
*
|
|
|
|
* default: true
|
|
|
|
* @TODO Move to a sub-class modular configuration
|
|
|
|
*/
|
|
|
|
@IsConfigurationNode(order = 1000)
|
|
|
|
public boolean getMetrics() {
|
|
|
|
return config.getBoolean("metrics", true);
|
|
|
|
}
|
|
|
|
|
2013-01-20 12:15:34 +00:00
|
|
|
/**
|
|
|
|
* Debug
|
2013-02-01 21:25:43 +00:00
|
|
|
*
|
|
|
|
* The debug modus spams much details about the plugin to the server-log (console) which can help to solve issues.
|
|
|
|
*
|
|
|
|
* default: false
|
2013-01-20 12:15:34 +00:00
|
|
|
*/
|
|
|
|
@IsConfigurationNode(order = 9999)
|
|
|
|
public boolean getDebug() {
|
|
|
|
return config.getBoolean("debug", false);
|
|
|
|
}
|
2013-01-18 21:51:08 +00:00
|
|
|
}
|