forked from LogBlock/LogBlock
Added version entry in config
This commit is contained in:
@@ -30,9 +30,12 @@ public class Config {
|
|||||||
String logLeavesDecayAs;
|
String logLeavesDecayAs;
|
||||||
boolean usePermissions;
|
boolean usePermissions;
|
||||||
|
|
||||||
Config (Configuration config) {
|
Config (LogBlock logblock) {
|
||||||
|
Configuration config = logblock.getConfiguration();
|
||||||
config.load();
|
config.load();
|
||||||
List<String> keys = config.getKeys(null);
|
List<String> keys = config.getKeys(null);
|
||||||
|
if (!keys.contains("version"))
|
||||||
|
config.setProperty("version", logblock.getDescription().getVersion());
|
||||||
if (!keys.contains("worldNames"))
|
if (!keys.contains("worldNames"))
|
||||||
config.setProperty("worldNames", Arrays.asList(new String[]{"world"}));
|
config.setProperty("worldNames", Arrays.asList(new String[]{"world"}));
|
||||||
if (!keys.contains("worldTables"))
|
if (!keys.contains("worldTables"))
|
||||||
|
@@ -59,7 +59,7 @@ public class LogBlock extends JavaPlugin
|
|||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
log = getServer().getLogger();
|
log = getServer().getLogger();
|
||||||
try {
|
try {
|
||||||
config = new Config(getConfiguration());
|
config = new Config(this);
|
||||||
if (config.usePermissions) {
|
if (config.usePermissions) {
|
||||||
if (getServer().getPluginManager().getPlugin("Permissions") != null)
|
if (getServer().getPluginManager().getPlugin("Permissions") != null)
|
||||||
log.info("[LogBlock] Permissions enabled");
|
log.info("[LogBlock] Permissions enabled");
|
||||||
|
Reference in New Issue
Block a user