register new config setting

This commit is contained in:
Necrodoom 2013-01-30 18:47:19 +02:00
parent 6e4ba4302f
commit 623ff0f629

View File

@ -22,6 +22,7 @@ import org.yaml.snakeyaml.reader.UnicodeReader;
*/ */
public class GMConfiguration { public class GMConfiguration {
private boolean allowCommandBlocks = false;
private boolean opOverride = true; private boolean opOverride = true;
private boolean toggleValidate = true; private boolean toggleValidate = true;
private Integer saveInterval = 10; private Integer saveInterval = 10;
@ -40,6 +41,7 @@ public class GMConfiguration {
/* /*
* Set defaults * Set defaults
*/ */
allowCommandBlocks = false;
opOverride = true; opOverride = true;
toggleValidate = true; toggleValidate = true;
saveInterval = 10; saveInterval = 10;
@ -83,6 +85,7 @@ public class GMConfiguration {
try { try {
Map<String, Object> config = getElement("config", getElement("settings", GMconfig)); Map<String, Object> config = getElement("config", getElement("settings", GMconfig));
allowCommandBlocks = (Boolean) config.get("allow_commandblocks");
opOverride = (Boolean) config.get("opOverrides"); opOverride = (Boolean) config.get("opOverrides");
toggleValidate = (Boolean) config.get("validate_toggle"); toggleValidate = (Boolean) config.get("validate_toggle");
@ -142,6 +145,10 @@ public class GMConfiguration {
return (Map<String, Object>) map.get(element); return (Map<String, Object>) map.get(element);
} }
public boolean isAllowCommandBlocks() {
return allowCommandBlocks;
}
public boolean isOpOverride() { public boolean isOpOverride() {
@ -183,4 +190,4 @@ public class GMConfiguration {
} }
} }