mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Having an option to disable commands from the config was a bad idea that
encouraged lazy admins. NOTE: If you were using these config options instead of relying on permissions, you will need to reconfigure these commands to be disabled via permissions.
This commit is contained in:
parent
a3e9d12f6a
commit
2df285fd7c
@ -44,7 +44,7 @@ public class MccCommand implements CommandExecutor {
|
|||||||
player.sendMessage("/mcstats " + LocaleLoader.getString("Commands.Stats"));
|
player.sendMessage("/mcstats " + LocaleLoader.getString("Commands.Stats"));
|
||||||
player.sendMessage("/mctop " + LocaleLoader.getString("Commands.Leaderboards"));
|
player.sendMessage("/mctop " + LocaleLoader.getString("Commands.Leaderboards"));
|
||||||
|
|
||||||
if (Config.getInstance().getCommandSkillResetEnabled() && Permissions.skillReset(player)) {
|
if (Permissions.skillReset(player)) {
|
||||||
player.sendMessage("/skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
|
player.sendMessage("/skillreset <skill|all> " + LocaleLoader.getString("Commands.Reset"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ public class Config extends ConfigLoader {
|
|||||||
/* General Settings */
|
/* General Settings */
|
||||||
public String getLocale() { return config.getString("General.Locale", "en_us"); }
|
public String getLocale() { return config.getString("General.Locale", "en_us"); }
|
||||||
public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
|
public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
|
||||||
|
public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); }
|
||||||
public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); }
|
public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); }
|
||||||
public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }
|
public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }
|
||||||
public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); }
|
public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); }
|
||||||
@ -74,34 +75,10 @@ public class Config extends ConfigLoader {
|
|||||||
public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
|
public boolean getArmorModsEnabled() { return config.getBoolean("Mods.Tool_Mods_Enabled", false); }
|
||||||
public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); }
|
public boolean getBlockModsEnabled() { return config.getBoolean("Mods.Block_Mods_Enabled", false); }
|
||||||
|
|
||||||
/* Commands */
|
/* Party Teleport Settings */
|
||||||
public boolean getCommandXPLockEnabled() { return config.getBoolean("Commands.xplock.Enabled", true); }
|
|
||||||
public boolean getCommandXPRateEnabled() { return config.getBoolean("Commands.xprate.Enabled", true); }
|
|
||||||
public boolean getCommandMCTopEnabled() { return config.getBoolean("Commands.mctop.Enabled", true); }
|
|
||||||
public boolean getCommandMCRankEnabled() { return config.getBoolean("Commands.mcrank.Enabled", true); }
|
|
||||||
public boolean getCommandAddXPEnabled() { return config.getBoolean("Commands.addxp.Enabled", true); }
|
|
||||||
public boolean getCommandMCAbilityEnabled() { return config.getBoolean("Commands.mcability.Enabled", true); }
|
|
||||||
public boolean getCommandMCRefreshEnabled() { return config.getBoolean("Commands.mcrefresh.Enabled", true); }
|
|
||||||
public boolean getCommandmcMMOEnabled() { return config.getBoolean("Commands.mcmmo.Enabled", true); }
|
|
||||||
public boolean getCommandMCCEnabled() { return config.getBoolean("Commands.mcc.Enabled", true); }
|
|
||||||
public boolean getCommandMCGodEnabled() { return config.getBoolean("Commands.mcgod.Enabled", true); }
|
|
||||||
public boolean getCommandMCStatsEnabled() { return config.getBoolean("Commands.mcstats.Enabled", true); }
|
|
||||||
public boolean getCommandSkillResetEnabled() { return config.getBoolean("Commands.skillreset.Enabled", true); }
|
|
||||||
public boolean getCommandMmoeditEnabled() { return config.getBoolean("Commands.mmoedit.Enabled", true); }
|
|
||||||
public boolean getCommandMCRemoveEnabled() { return config.getBoolean("Commands.mcremove.Enable", true); }
|
|
||||||
public boolean getCommandMCPurgeEnabled() { return config.getBoolean("Commands.mcpurge.Enable", true); }
|
|
||||||
public boolean getCommandPTPEnabled() { return config.getBoolean("Commands.ptp.Enabled", true); }
|
|
||||||
public boolean getCommandPartyEnabled() { return config.getBoolean("Commands.party.Enabled", true); }
|
|
||||||
public boolean getCommandInspectEnabled() { return config.getBoolean("Commands.inspect.Enabled", true); }
|
|
||||||
public boolean getCommandInviteEnabled() { return config.getBoolean("Commands.invite.Enabled", true); }
|
|
||||||
public boolean getCommandAcceptEnabled() { return config.getBoolean("Commands.accept.Enabled", true); }
|
|
||||||
public boolean getCommandAdminChatAEnabled() { return config.getBoolean("Commands.a.Enabled", true); }
|
|
||||||
public boolean getCommandPartyChatPEnabled() { return config.getBoolean("Commands.p.Enabled", true); }
|
|
||||||
|
|
||||||
public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 30); }
|
public int getPTPCommandCooldown() { return config.getInt("Commands.ptp.Cooldown", 30); }
|
||||||
public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); }
|
public int getPTPCommandTimeout() { return config.getInt("Commands.ptp.Request_Timeout", 300); }
|
||||||
public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); }
|
public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); }
|
||||||
public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); }
|
|
||||||
|
|
||||||
/* Items */
|
/* Items */
|
||||||
public int getChimaeraCost() { return config.getInt("Items.Chimaera_Wing.Feather_Cost", 10); }
|
public int getChimaeraCost() { return config.getInt("Items.Chimaera_Wing.Feather_Cost", 10); }
|
||||||
|
@ -327,92 +327,34 @@ public class mcMMO extends JavaPlugin {
|
|||||||
Config configInstance = Config.getInstance();
|
Config configInstance = Config.getInstance();
|
||||||
|
|
||||||
// mc* commands
|
// mc* commands
|
||||||
if (configInstance.getCommandMCPurgeEnabled()) {
|
getCommand("mcpurge").setExecutor(new McpurgeCommand());
|
||||||
getCommand("mcpurge").setExecutor(new McpurgeCommand());
|
getCommand("mcremove").setExecutor(new McremoveCommand());
|
||||||
}
|
getCommand("mcability").setExecutor(new McabilityCommand());
|
||||||
if (configInstance.getCommandMCRemoveEnabled()) {
|
getCommand("mcc").setExecutor(new MccCommand());
|
||||||
getCommand("mcremove").setExecutor(new McremoveCommand());
|
getCommand("mcgod").setExecutor(new McgodCommand());
|
||||||
}
|
getCommand("mcmmo").setExecutor(new McmmoCommand());
|
||||||
|
getCommand("mcrefresh").setExecutor(new McrefreshCommand());
|
||||||
if (configInstance.getCommandMCAbilityEnabled()) {
|
getCommand("mctop").setExecutor(new MctopCommand());
|
||||||
getCommand("mcability").setExecutor(new McabilityCommand());
|
getCommand("mcrank").setExecutor(new McrankCommand());
|
||||||
}
|
getCommand("mcstats").setExecutor(new McstatsCommand());
|
||||||
|
|
||||||
if (configInstance.getCommandMCCEnabled()) {
|
|
||||||
getCommand("mcc").setExecutor(new MccCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandMCGodEnabled()) {
|
|
||||||
getCommand("mcgod").setExecutor(new McgodCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandmcMMOEnabled()) {
|
|
||||||
getCommand("mcmmo").setExecutor(new McmmoCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandMCRefreshEnabled()) {
|
|
||||||
getCommand("mcrefresh").setExecutor(new McrefreshCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandMCTopEnabled()) {
|
|
||||||
getCommand("mctop").setExecutor(new MctopCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(configInstance.getCommandMCRankEnabled()) {
|
|
||||||
getCommand("mcrank").setExecutor(new McrankCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandMCStatsEnabled()) {
|
|
||||||
getCommand("mcstats").setExecutor(new McstatsCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandSkillResetEnabled()) {
|
|
||||||
getCommand("skillreset").setExecutor(new SkillResetCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Party commands
|
// Party commands
|
||||||
if (configInstance.getCommandAdminChatAEnabled()) {
|
getCommand("a").setExecutor(new ACommand());
|
||||||
getCommand("a").setExecutor(new ACommand());
|
getCommand("party").setExecutor(new PartyCommand());
|
||||||
}
|
getCommand("p").setExecutor(new PCommand(this));
|
||||||
|
getCommand("ptp").setExecutor(new PtpCommand(this));
|
||||||
if (configInstance.getCommandPartyEnabled()) {
|
|
||||||
getCommand("party").setExecutor(new PartyCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandPartyChatPEnabled()) {
|
|
||||||
getCommand("p").setExecutor(new PCommand(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandPTPEnabled()) {
|
|
||||||
getCommand("ptp").setExecutor(new PtpCommand(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Other commands
|
// Other commands
|
||||||
if (configInstance.getCommandAddXPEnabled()) {
|
getCommand("addxp").setExecutor(new AddxpCommand());
|
||||||
getCommand("addxp").setExecutor(new AddxpCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
CommandRegistrationHelper.registerAddlevelsCommand();
|
CommandRegistrationHelper.registerAddlevelsCommand();
|
||||||
|
getCommand("mmoedit").setExecutor(new MmoeditCommand());
|
||||||
if (configInstance.getCommandMmoeditEnabled()) {
|
getCommand("inspect").setExecutor(new InspectCommand());
|
||||||
getCommand("mmoedit").setExecutor(new MmoeditCommand());
|
getCommand("xprate").setExecutor(new XprateCommand());
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandInspectEnabled()) {
|
|
||||||
getCommand("inspect").setExecutor(new InspectCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (configInstance.getCommandXPRateEnabled()) {
|
|
||||||
getCommand("xprate").setExecutor(new XprateCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommand("mmoupdate").setExecutor(new MmoupdateCommand());
|
getCommand("mmoupdate").setExecutor(new MmoupdateCommand());
|
||||||
|
getCommand("skillreset").setExecutor(new SkillResetCommand());
|
||||||
|
|
||||||
// Spout commands
|
// Spout commands
|
||||||
if (configInstance.getCommandXPLockEnabled()) {
|
getCommand("xplock").setExecutor(new XplockCommand());
|
||||||
getCommand("xplock").setExecutor(new XplockCommand());
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommand("mchud").setExecutor(new MchudCommand());
|
getCommand("mchud").setExecutor(new MchudCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public class XplockCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mcMMO.spoutEnabled || !Config.getInstance().getCommandXPLockEnabled() || !SpoutConfig.getInstance().getXPBarEnabled()) {
|
if (!mcMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled()) {
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user