Skip to content
Browse files

Use ConfigurationHolderConfiguration

  • Loading branch information...
1 parent 1bb940c commit e281e4f88a7dfda54e6d3def3f30099daff2b39b @zml2008 zml2008 committed Apr 16, 2012
Showing with 3 additions and 18 deletions.
  1. +3 −18 src/main/java/org/spout/vanilla/configuration/VanillaConfiguration.java
View
21 src/main/java/org/spout/vanilla/configuration/VanillaConfiguration.java
@@ -27,15 +27,14 @@
import org.spout.api.exception.ConfigurationException;
import org.spout.api.util.config.ConfigurationHolder;
+import org.spout.api.util.config.ConfigurationHolderConfiguration;
import org.spout.api.util.config.yaml.YamlConfiguration;
import org.spout.vanilla.VanillaPlugin;
import java.io.File;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-public class VanillaConfiguration extends YamlConfiguration {
+public class VanillaConfiguration extends ConfigurationHolderConfiguration {
// General
public static final ConfigurationHolder MOTD = new ConfigurationHolder("A Spout Server", "general", "motd");
public static final ConfigurationHolder ENABLE_END_CREDITS = new ConfigurationHolder(true, "general", "enable-ending-credits");
@@ -61,21 +60,7 @@
public static final ConfigurationHolder ITEM_PICKUP_RANGE = new ConfigurationHolder(3, "controller", "item-pickup-range");
public VanillaConfiguration(File dataFolder) {
- super(new File(dataFolder, "config.yml"));
- for (Field field : VanillaConfiguration.class.getFields()) {
- if (Modifier.isStatic(field.getModifiers())) {
- try {
- Object f = field.get(null);
- if (f instanceof ConfigurationHolder) {
- ConfigurationHolder node = (ConfigurationHolder) f;
- node.setConfiguration(this);
- node.getValue();
- }
- } catch (IllegalArgumentException e) {
- } catch (IllegalAccessException e) {
- }
- }
- }
+ super(new YamlConfiguration(new File(dataFolder, "config.yml")));
}
@Override

0 comments on commit e281e4f

Please sign in to comment.
Something went wrong with that request. Please try again.