forked from LogBlock/LogBlock
Readded default enabled logging options
This commit is contained in:
@@ -198,7 +198,7 @@ class WorldConfig extends LoggingEnabledMapping
|
|||||||
final Map<String, Object> def = new HashMap<String, Object>();
|
final Map<String, Object> def = new HashMap<String, Object>();
|
||||||
def.put("table", "lb-" + file.getName().substring(0, file.getName().length() - 4));
|
def.put("table", "lb-" + file.getName().substring(0, file.getName().length() - 4));
|
||||||
for (final Logging l : Logging.values())
|
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);
|
final YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
|
||||||
for (final Entry<String, Object> e : def.entrySet())
|
for (final Entry<String, Object> e : def.entrySet())
|
||||||
if (config.get(e.getKey()) == null)
|
if (config.get(e.getKey()) == null)
|
||||||
|
@@ -1,7 +1,21 @@
|
|||||||
package de.diddiz.LogBlock;
|
package de.diddiz.LogBlock;
|
||||||
|
|
||||||
public enum Logging {
|
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;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user