From bbdd85457b01fa673ad408026f033a94775d00ee Mon Sep 17 00:00:00 2001 From: Jonathan Devine Date: Sat, 11 Aug 2012 17:34:38 +0100 Subject: [PATCH] Enabled Verbose Logging Toggling --- .../src/com/untamedears/citadel/Citadel.java | 7 ++++++- .../src/com/untamedears/citadel/ConfigManager.java | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/citadel-paper/src/com/untamedears/citadel/Citadel.java b/plugins/citadel-paper/src/com/untamedears/citadel/Citadel.java index 3aad74924..4d8da7032 100644 --- a/plugins/citadel-paper/src/com/untamedears/citadel/Citadel.java +++ b/plugins/citadel-paper/src/com/untamedears/citadel/Citadel.java @@ -19,6 +19,7 @@ import com.untamedears.citadel.command.commands.DeleteCommand; import com.untamedears.citadel.command.commands.DisallowCommand; import com.untamedears.citadel.command.commands.FortifyCommand; import com.untamedears.citadel.command.commands.GroupCommand; +import com.untamedears.citadel.command.commands.GroupInfoCommand; import com.untamedears.citadel.command.commands.GroupsCommand; import com.untamedears.citadel.command.commands.InfoCommand; import com.untamedears.citadel.command.commands.JoinCommand; @@ -72,6 +73,7 @@ public class Citadel extends JavaPlugin { public void onEnable() { plugin = this; dao = new CitadelDao(this); + dao.updateDatabase(); setUpStorage(); registerCommands(); registerEvents(); @@ -109,6 +111,7 @@ public class Citadel extends JavaPlugin { commandHandler.addCommand(new DisallowCommand()); commandHandler.addCommand(new FortifyCommand()); commandHandler.addCommand(new GroupCommand()); + commandHandler.addCommand(new GroupInfoCommand()); commandHandler.addCommand(new GroupsCommand()); //commandHandler.addCommand(new Help()) commandHandler.addCommand(new InfoCommand()); @@ -151,7 +154,9 @@ public class Citadel extends JavaPlugin { } public static void info(String message){ - log.info("[Citadel] " + message); + if(configManager.getVerboseLogging()){ + log.info("[Citadel] " + message); + } } public static void severe(String message){ diff --git a/plugins/citadel-paper/src/com/untamedears/citadel/ConfigManager.java b/plugins/citadel-paper/src/com/untamedears/citadel/ConfigManager.java index 8ce5e1454..80566307e 100644 --- a/plugins/citadel-paper/src/com/untamedears/citadel/ConfigManager.java +++ b/plugins/citadel-paper/src/com/untamedears/citadel/ConfigManager.java @@ -19,6 +19,7 @@ public class ConfigManager { private int autoModeReset; private boolean verboseLogging; private double redstoneDistance; + private int groupsAllowed; public void load(){ Citadel.getPlugin().reloadConfig(); @@ -28,6 +29,7 @@ public class ConfigManager { autoModeReset = config.getInt("general.autoModeReset"); verboseLogging = config.getBoolean("general.verboseLogging"); redstoneDistance = config.getDouble("general.redstoneDistance"); + groupsAllowed = config.getInt("general.groupsAllowed"); for (Object obj : config.getList("materials")) { LinkedHashMap map = (LinkedHashMap) obj; ReinforcementMaterial.put(new ReinforcementMaterial(map)); @@ -61,4 +63,12 @@ public class ConfigManager { public int getFlashLength(){ return this.flashLength; } + + public int getGroupsAllowed(){ + return this.groupsAllowed; + } + + public boolean getVerboseLogging(){ + return this.verboseLogging; + } }