Config overhaul part 3

This commit is contained in:
nossr50 2012-04-26 07:55:38 -07:00
parent 2f58e593e5
commit 945e5ca11c
3 changed files with 42 additions and 47 deletions

View File

@ -26,7 +26,7 @@ public class XplockCommand implements CommandExecutor {
return true; return true;
} }
if (!Config.spoutEnabled || !Config.xpbar || !Config.xplockEnable) { if (!Config.spoutEnabled || !Config.xpbar || !Config.getCommandXPLockEnabled()) {
sender.sendMessage(mcLocale.getString("Commands.Disabled")); sender.sendMessage(mcLocale.getString("Commands.Disabled"));
return true; return true;
} }

View File

@ -31,11 +31,27 @@ public class Config extends ConfigLoader{
} }
/* Commands */ /* Commands */
public static Boolean xplockEnable, xprateEnable, mccEnable, mcmmoEnable, public static boolean getCommandXPLockEnabled() { return config.getBoolean("Commands.xplock.Enabled", true); }
partyEnable, inviteEnable, acceptEnable, inspectEnable, public static boolean getCommandXPRateEnabled() { return config.getBoolean("Commands.xprate.Enabled", true); }
mcstatsEnable, addxpEnable, ptpEnable, mmoeditEnable, public static boolean getCommandMCTopEnabled() { return config.getBoolean("Commands.mctop.Enabled", true); }
mcremoveEnable, mcgodEnable, mcabilityEnable, mctopEnable, public static boolean getCommandAddXPEnabled() { return config.getBoolean("Commands.addxp.Enabled", true); }
addlevelsEnable, mcrefreshEnable, aEnable, pEnable; public static boolean getCommandAddLevelsEnabled() { return config.getBoolean("Commands.addlevels.Enabled", true); }
public static boolean getCommandMCAbilityEnabled() { return config.getBoolean("Commands.mcability.Enabled", true); }
public static boolean getCommandMCRefreshEnabled() { return config.getBoolean("Commands.mcrefresh.Enabled", true); }
public static boolean getCommandmcMMOEnabled() { return config.getBoolean("Commands.mcmmo.Enabled", true); }
public static boolean getCommandMCCEnabled() { return config.getBoolean("Commands.mcc.Enabled", true); }
public static boolean getCommandMCGodEnabled() { return config.getBoolean("Commands.mcgod.Enabled", true); }
public static boolean getCommandMCStatsEnabled() { return config.getBoolean("Commands.mcstats.Enabled", true); }
public static boolean getCommandMmoeditEnabled() { return config.getBoolean("Commands.mmoedit.Enabled", true); }
public static boolean getCommandMCRemoveEnabled() { return config.getBoolean("Commands.mcremove.Enable", true); }
public static boolean getCommandPTPEnabled() { return config.getBoolean("Commands.ptp.Enabled", true); }
public static boolean getCommandPartyEnabled() { return config.getBoolean("Commands.party.Enabled", true); }
public static boolean getCommandInspectEnabled() { return config.getBoolean("Commands.inspect.Enabled", true); }
public static boolean getCommandInviteEnabled() { return config.getBoolean("Commands.invite.Enabled", true); }
public static boolean getCommandAcceptEnabled() { return config.getBoolean("Commands.accept.Enabled", true); }
public static boolean getCommandAdminChatAEnabled() { return config.getBoolean("Commands.a.Enabled", true); }
public static boolean getCommandPartyChatPEnabled() { return config.getBoolean("Commands.p.Enabled", true); }
public static int ptpCommandCooldown; public static int ptpCommandCooldown;
public static Boolean donateMessage; public static Boolean donateMessage;
@ -421,27 +437,6 @@ public class Config extends ConfigLoader{
fishingTier4 = config.getInt("Fishing.Tier_Levels.Tier4", 600); fishingTier4 = config.getInt("Fishing.Tier_Levels.Tier4", 600);
fishingTier5 = config.getInt("Fishing.Tier_Levels.Tier5", 800); fishingTier5 = config.getInt("Fishing.Tier_Levels.Tier5", 800);
xplockEnable = config.getBoolean("Commands.xplock.Enabled", true);
xprateEnable = config.getBoolean("Commands.xprate.Enabled", true);
mctopEnable = config.getBoolean("Commands.mctop.Enabled", true);
addxpEnable = config.getBoolean("Commands.addxp.Enabled", true);
addlevelsEnable = config.getBoolean("Commands.addlevels.Enabled", true);
mcabilityEnable = config.getBoolean("Commands.mcability.Enabled", true);
mcrefreshEnable = config.getBoolean("Commands.mcrefresh.Enabled", true);
mcmmoEnable = config.getBoolean("Commands.mcmmo.Enabled", true);
mccEnable = config.getBoolean("Commands.mcc.Enabled", true);
mcgodEnable = config.getBoolean("Commands.mcgod.Enabled", true);
mcstatsEnable = config.getBoolean("Commands.mcstats.Enabled", true);
mmoeditEnable = config.getBoolean("Commands.mmoedit.Enabled", true);
mcremoveEnable = config.getBoolean("Commands.mcremove.Enable", true);
ptpEnable = config.getBoolean("Commands.ptp.Enabled", true);
partyEnable = config.getBoolean("Commands.party.Enabled", true);
inspectEnable = config.getBoolean("Commands.inspect.Enabled", true);
inviteEnable = config.getBoolean("Commands.invite.Enabled", true);
acceptEnable = config.getBoolean("Commands.accept.Enabled", true);
aEnable = config.getBoolean("Commands.a.Enabled", true);
pEnable = config.getBoolean("Commands.p.Enabled", true);
ptpCommandCooldown = config.getInt("Commands.ptp.Cooldown", 30); ptpCommandCooldown = config.getInt("Commands.ptp.Cooldown", 30);
detonatorID = config.getInt("Skills.Mining.Detonator_ID", 259); detonatorID = config.getInt("Skills.Mining.Detonator_ID", 259);

View File

@ -247,88 +247,88 @@ public class mcMMO extends JavaPlugin {
getCommand("woodcutting").setExecutor(new WoodcuttingCommand()); getCommand("woodcutting").setExecutor(new WoodcuttingCommand());
//mc* commands //mc* commands
if (Config.mcremoveEnable) { if (Config.getCommandMCRemoveEnabled()) {
getCommand("mcremove").setExecutor(new McremoveCommand(this)); getCommand("mcremove").setExecutor(new McremoveCommand(this));
} }
if (Config.mcabilityEnable) { if (Config.getCommandMCAbilityEnabled()) {
getCommand("mcability").setExecutor(new McabilityCommand()); getCommand("mcability").setExecutor(new McabilityCommand());
} }
if (Config.mccEnable) { if (Config.getCommandMCCEnabled()) {
getCommand("mcc").setExecutor(new MccCommand()); getCommand("mcc").setExecutor(new MccCommand());
} }
if (Config.mcgodEnable) { if (Config.getCommandMCGodEnabled()) {
getCommand("mcgod").setExecutor(new McgodCommand()); getCommand("mcgod").setExecutor(new McgodCommand());
} }
if (Config.mcmmoEnable) { if (Config.getCommandmcMMOEnabled()) {
getCommand("mcmmo").setExecutor(new McmmoCommand()); getCommand("mcmmo").setExecutor(new McmmoCommand());
} }
if (Config.mcrefreshEnable) { if (Config.getCommandMCRefreshEnabled()) {
getCommand("mcrefresh").setExecutor(new McrefreshCommand(this)); getCommand("mcrefresh").setExecutor(new McrefreshCommand(this));
} }
if (Config.mctopEnable) { if (Config.getCommandMCTopEnabled()) {
getCommand("mctop").setExecutor(new MctopCommand()); getCommand("mctop").setExecutor(new MctopCommand());
} }
if (Config.mcstatsEnable) { if (Config.getCommandMCStatsEnabled()) {
getCommand("mcstats").setExecutor(new McstatsCommand()); getCommand("mcstats").setExecutor(new McstatsCommand());
} }
//Party commands //Party commands
if (Config.acceptEnable) { if (Config.getCommandAcceptEnabled()) {
getCommand("accept").setExecutor(new AcceptCommand(this)); getCommand("accept").setExecutor(new AcceptCommand(this));
} }
if (Config.aEnable) { if (Config.getCommandAdminChatAEnabled()) {
getCommand("a").setExecutor(new ACommand(this)); getCommand("a").setExecutor(new ACommand(this));
} }
if (Config.inviteEnable) { if (Config.getCommandInviteEnabled()) {
getCommand("invite").setExecutor(new InviteCommand(this)); getCommand("invite").setExecutor(new InviteCommand(this));
} }
if (Config.partyEnable) { if (Config.getCommandPartyEnabled()) {
getCommand("party").setExecutor(new PartyCommand(this)); getCommand("party").setExecutor(new PartyCommand(this));
} }
if (Config.pEnable) { if (Config.getCommandPartyChatPEnabled()) {
getCommand("p").setExecutor(new PCommand(this)); getCommand("p").setExecutor(new PCommand(this));
} }
if (Config.ptpEnable) { if (Config.getCommandPTPEnabled()) {
getCommand("ptp").setExecutor(new PtpCommand(this)); getCommand("ptp").setExecutor(new PtpCommand(this));
} }
//Other commands //Other commands
if (Config.addxpEnable) { if (Config.getCommandAddXPEnabled()) {
getCommand("addxp").setExecutor(new AddxpCommand(this)); getCommand("addxp").setExecutor(new AddxpCommand(this));
} }
if (Config.addlevelsEnable) { if (Config.getCommandAddLevelsEnabled()) {
getCommand("addlevels").setExecutor(new AddlevelsCommand(this)); getCommand("addlevels").setExecutor(new AddlevelsCommand(this));
} }
if (Config.mmoeditEnable) { if (Config.getCommandMmoeditEnabled()) {
getCommand("mmoedit").setExecutor(new MmoeditCommand(this)); getCommand("mmoedit").setExecutor(new MmoeditCommand(this));
} }
if (Config.inspectEnable) { if (Config.getCommandInspectEnabled()) {
getCommand("inspect").setExecutor(new InspectCommand(this)); getCommand("inspect").setExecutor(new InspectCommand(this));
} }
if (Config.xprateEnable) { if (Config.getCommandXPRateEnabled()) {
getCommand("xprate").setExecutor(new XprateCommand(this)); getCommand("xprate").setExecutor(new XprateCommand(this));
} }
getCommand("mmoupdate").setExecutor(new MmoupdateCommand(this)); getCommand("mmoupdate").setExecutor(new MmoupdateCommand(this));
//Spout commands //Spout commands
if (Config.xplockEnable) { if (Config.getCommandXPLockEnabled()) {
getCommand("xplock").setExecutor(new XplockCommand()); getCommand("xplock").setExecutor(new XplockCommand());
} }