Readded default enabled logging options

This commit is contained in:
Robin Kupper
2011-11-29 12:40:14 +01:00
parent 1310843287
commit de24cc0f7e
2 changed files with 16 additions and 2 deletions

View File

@@ -198,7 +198,7 @@ class WorldConfig extends LoggingEnabledMapping
final Map<String, Object> def = new HashMap<String, Object>();
def.put("table", "lb-" + file.getName().substring(0, file.getName().length() - 4));
for (final Logging l : Logging.values())
def.put("logging." + l.toString(), false);
def.put("logging." + l.toString(), l.isDefaultEnabled());
final YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
for (final Entry<String, Object> e : def.entrySet())
if (config.get(e.getKey()) == null)

View File

@@ -1,7 +1,21 @@
package de.diddiz.LogBlock;
public enum Logging {
BLOCKPLACE, BLOCKBREAK, SIGNTEXT, TNTEXPLOSION, CREEPEREXPLOSION, GHASTFIREBALLEXPLOSION, MISCEXPLOSION, FIRE, LEAVESDECAY, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN;
BLOCKPLACE(true), BLOCKBREAK(true), SIGNTEXT, TNTEXPLOSION(true), CREEPEREXPLOSION(true), GHASTFIREBALLEXPLOSION(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN;
public static int length = Logging.values().length;
private final boolean defaultEnabled;
private Logging() {
this(false);
}
private Logging(boolean defaultEnabled) {
this.defaultEnabled = defaultEnabled;
}
public boolean isDefaultEnabled() {
return defaultEnabled;
}
}