From e9b016903b82b85e457ef4df98f1f3c0a3b5cdde Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 12 Feb 2013 18:30:03 -0500 Subject: [PATCH] Removed /mcc command. Replaced with /mcmmo help. NOTE: /mcmmo help seems to be having formatting issues currently - we're looking into it. --- Changelog.txt | 1 + .../commands/CommandRegistrationHelper.java | 4 +- .../nossr50/commands/player/MccCommand.java | 79 ------------------- .../nossr50/commands/player/McmmoCommand.java | 73 ++++++++++++++++- src/main/java/com/gmail/nossr50/mcMMO.java | 2 - .../resources/locale/locale_en_US.properties | 2 +- src/main/resources/plugin.yml | 15 ++-- 7 files changed, 83 insertions(+), 93 deletions(-) delete mode 100644 src/main/java/com/gmail/nossr50/commands/player/MccCommand.java diff --git a/Changelog.txt b/Changelog.txt index 7b5608034..2081dc5ee 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -77,6 +77,7 @@ Version 1.4.00-dev - Removed unused "healthbar" files from the resources - Removed config options for disabling commands from the config.yml. This should instead be done through permissions. - Removed Chimaera Wing + - Removed /mcc command. Replaced with /mcmmo [?|help|commands] Version 1.3.14 + Added new Hylian Luck skill to Herbalism. diff --git a/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java b/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java index 9625f097d..bd43f8f20 100644 --- a/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java +++ b/src/main/java/com/gmail/nossr50/commands/CommandRegistrationHelper.java @@ -212,10 +212,10 @@ public final class CommandRegistrationHelper { public static void registerMcmmoCommand() { PluginCommand command = mcMMO.p.getCommand("mcmmo"); command.setDescription(LocaleLoader.getString("Commands.Description.mcmmo")); - command.setPermission("mcmmo.commands.mcmmo"); + command.setPermission("mcmmo.commands.mcmmo;mcmmo.commands.mcmmo.help"); command.setPermissionMessage(permissionsMessage); command.setUsage(LocaleLoader.getString("Commands.Usage.0", "mcmmo")); - command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "mcmmo", "?")); + command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "mcmmo", "help")); command.setExecutor(new McmmoCommand()); } diff --git a/src/main/java/com/gmail/nossr50/commands/player/MccCommand.java b/src/main/java/com/gmail/nossr50/commands/player/MccCommand.java deleted file mode 100644 index 56cc1f761..000000000 --- a/src/main/java/com/gmail/nossr50/commands/player/MccCommand.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.gmail.nossr50.commands.player; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import com.gmail.nossr50.commands.CommandHelper; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Permissions; - -//TODO: Rework this whole thing. It's ugly. Also is missing all the admin & spout commands. -public class MccCommand implements CommandExecutor { - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (CommandHelper.noConsoleUsage(sender)) { - return true; - } - - if (!Permissions.hasPermission(sender, "mcmmo.commands.mcc")) { - return true; - } - - Player player = (Player) sender; - - player.sendMessage(LocaleLoader.getString("Commands.mcc.Header")); - - if (Permissions.party(player)) { - player.sendMessage(LocaleLoader.getString("Commands.Party.Commands")); - player.sendMessage("/party create <" + LocaleLoader.getString("Commands.Usage.PartyName") + "> " + LocaleLoader.getString("Commands.Party1")); - player.sendMessage("/party join <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party2")); - player.sendMessage("/party quit " + LocaleLoader.getString("Commands.Party.Quit")); - - if (Permissions.partyChat(player)) { - player.sendMessage("/p " + LocaleLoader.getString("Commands.Party.Toggle")); - } - - player.sendMessage("/party invite <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Invite")); - player.sendMessage("/party accept " + LocaleLoader.getString("Commands.Party.Accept")); - - if (Permissions.partyTeleport(player)) { - player.sendMessage("/ptp " + LocaleLoader.getString("Commands.Party.Teleport")); - } - } - - player.sendMessage(LocaleLoader.getString("Commands.Other")); - player.sendMessage("/mcstats " + LocaleLoader.getString("Commands.Stats")); - player.sendMessage("/mctop " + LocaleLoader.getString("Commands.Leaderboards")); - - if (Permissions.skillReset(player)) { - player.sendMessage("/skillreset " + LocaleLoader.getString("Commands.Reset")); - } - - if (Permissions.mcAbility(player)) { - player.sendMessage("/mcability " + LocaleLoader.getString("Commands.ToggleAbility")); - } - - if (Permissions.adminChat(player)) { - player.sendMessage("/a " + LocaleLoader.getString("Commands.AdminToggle")); - } - - if (Permissions.inspect(player)) { - player.sendMessage("/inspect " + LocaleLoader.getString("Commands.Inspect")); - } - - if (Permissions.mmoedit(player)) { - player.sendMessage("/mmoedit " + LocaleLoader.getString("Commands.mmoedit")); - } - - if (Permissions.mcgod(player)) { - player.sendMessage("/mcgod " + LocaleLoader.getString("Commands.mcgod")); - } - - player.sendMessage(LocaleLoader.getString("Commands.SkillInfo")); - player.sendMessage("/mcmmo " + LocaleLoader.getString("Commands.ModDescription")); - - return true; - } -} diff --git a/src/main/java/com/gmail/nossr50/commands/player/McmmoCommand.java b/src/main/java/com/gmail/nossr50/commands/player/McmmoCommand.java index 2429feb81..c64677786 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/McmmoCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/McmmoCommand.java @@ -10,12 +10,14 @@ import org.getspout.spoutapi.player.SpoutPlayer; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.util.Permissions; public class McmmoCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (args.length == 0 || (args.length == 1 && args[0].equals("?"))) { + switch (args.length) { + case 0: String description = LocaleLoader.getString("mcMMO.Description"); String[] mcSplit = description.split(","); sender.sendMessage(mcSplit); @@ -32,8 +34,75 @@ public class McmmoCommand implements CommandExecutor { sender.sendMessage(LocaleLoader.getString("MOTD.Version", mcMMO.p.getDescription().getVersion())); return true; + + case 1: + if (args[0].equalsIgnoreCase("?") || args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("commands")) { + if (!Permissions.hasPermission(sender, "mcmmo.commands.mcmmo.help")) { + sender.sendMessage(command.getPermissionMessage()); + return true; + } + + sender.sendMessage(LocaleLoader.getString("Commands.mcc.Header")); + displayPartyCommands(sender); + displayOtherCommands(sender); + + } + return true; + + default: + return false; + } + } + + private void displayPartyCommands(CommandSender sender) { + if (sender.hasPermission("mcmmo.commands.party")) { + sender.sendMessage(LocaleLoader.getString("Commands.Party.Commands")); + sender.sendMessage("/party create <" + LocaleLoader.getString("Commands.Usage.PartyName") + "> " + LocaleLoader.getString("Commands.Party1")); + sender.sendMessage("/party join <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party2")); + sender.sendMessage("/party quit " + LocaleLoader.getString("Commands.Party.Quit")); + + if (sender.hasPermission("mcmmo.chat.party")) { + sender.sendMessage("/party chat " + LocaleLoader.getString("Commands.Party.Toggle")); + } + + sender.sendMessage("/party invite <" + LocaleLoader.getString("Commands.Usage.Player") + "> " + LocaleLoader.getString("Commands.Party.Invite")); + sender.sendMessage("/party accept " + LocaleLoader.getString("Commands.Party.Accept")); + + if (sender.hasPermission("mcmmo.commands.ptp")) { + sender.sendMessage("/party teleport " + LocaleLoader.getString("Commands.Party.Teleport")); + } + } + } + + private void displayOtherCommands(CommandSender sender) { + sender.sendMessage(LocaleLoader.getString("Commands.Other")); + sender.sendMessage("/mcstats " + LocaleLoader.getString("Commands.Stats")); + sender.sendMessage("/mctop " + LocaleLoader.getString("Commands.Leaderboards")); + + if (sender.hasPermission("mcmmo.commands.skillreset")) { + sender.sendMessage("/skillreset " + LocaleLoader.getString("Commands.Reset")); } - return false; + if (sender.hasPermission("mcmmo.commands.mcability")) { + sender.sendMessage("/mcability " + LocaleLoader.getString("Commands.ToggleAbility")); + } + + if (sender.hasPermission("mcmmo.chat.admin")) { + sender.sendMessage("/adminchat " + LocaleLoader.getString("Commands.AdminToggle")); + } + + if (sender.hasPermission("mcmmo.commands.inspect")) { + sender.sendMessage("/inspect " + LocaleLoader.getString("Commands.Inspect")); + } + + if (sender.hasPermission("mcmmo.commands.mmoedit")) { + sender.sendMessage("/mmoedit " + LocaleLoader.getString("Commands.mmoedit")); + } + + if (sender.hasPermission("mcmmo.commands.mcgod")) { + sender.sendMessage("/mcgod " + LocaleLoader.getString("Commands.mcgod")); + } + + sender.sendMessage(LocaleLoader.getString("Commands.SkillInfo")); } } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 3641e100f..3c5befbca 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -23,7 +23,6 @@ import org.mcstats.Metrics.Graph; import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManager; import com.gmail.nossr50.util.blockmeta.chunkmeta.ChunkManagerFactory; import com.gmail.nossr50.commands.CommandRegistrationHelper; -import com.gmail.nossr50.commands.player.MccCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.HiddenConfig; @@ -277,7 +276,6 @@ public class mcMMO extends JavaPlugin { CommandRegistrationHelper.registerMcpurgeCommand(); CommandRegistrationHelper.registerMcremoveCommand(); CommandRegistrationHelper.registerMcabilityCommand(); - getCommand("mcc").setExecutor(new MccCommand()); CommandRegistrationHelper.registerMcgodCommand(); CommandRegistrationHelper.registerMcmmoCommand(); CommandRegistrationHelper.registerMcrefreshCommand(); diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 809adc2c6..0bf32b421 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -394,7 +394,7 @@ Combat.TouchedFuzzy=[[DARK_RED]]Touched Fuzzy. Felt Dizzy. #COMMANDS ##generic -mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Founder),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Developer),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](Developer),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](Developer),[[GOLD]] - [[GREEN]]toothplck1 [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Bukkit Forum Thread +mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcmmo help[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Founder),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Developer),[[GOLD]] - [[GREEN]]TfT_02 [[BLUE]](Developer),[[GOLD]] - [[GREEN]]Glitchfinder [[BLUE]](Developer),[[GOLD]] - [[GREEN]]toothplck1 [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]https://github.com/mcMMO-Dev/mcMMO/issues[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat, Commands.addlevels.AwardAll.1=[[GREEN]]You were awarded {0} levels in all skills! Commands.addlevels.AwardAll.2=[[RED]]All skills have been modified for {0}. Commands.addlevels.AwardSkill.1=[[GREEN]]You were awarded {0} levels in {1}! diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 902569546..01be21eaf 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -28,9 +28,6 @@ commands: xprate: aliases: [mcxprate] description: Modify the xp rate or start an event - mcc: - aliases: [] - description: Lists mcMMO commands mcmmo: description: Shows a brief mod description mctop: @@ -564,9 +561,8 @@ permissions: mcmmo.commands.herbalism: true mcmmo.commands.inspect: true mcmmo.commands.mcability: true - mcmmo.commands.mcc: true mcmmo.commands.mchud: true - mcmmo.commands.mcmmo: true + mcmmo.commands.mcmmo.all: true mcmmo.commands.mcrank: true mcmmo.commands.mcstats: true mcmmo.commands.mctop.all: true @@ -651,16 +647,21 @@ permissions: description: Allows access to the mcability command mcmmo.commands.mcability.others: description: Allows access to the mcability command for other players - mcmmo.commands.mcc: - description: Allows access to the mcc command mcmmo.commands.mcgod: description: Allows access to the mcgod command mcmmo.commands.mcgod.others: description: Allows access to the mcgod command for other players mcmmo.commands.mchud: description: Allows access to the mchud command + mcmmo.commands.mcmmo.all: + description: Implies access to all mcmmo.commands.mcmmo permissions. + children: + mcmmo.commands.mcmmo: true + mcmmo.commands.mcmmo.help: true mcmmo.commands.mcmmo: description: Allows access to the mcmmo command + mcmmo.commands.mcmmo.help: + description: Allows access to the mcmmo help command mcmmo.commands.mcpurge: default: false description: Allows access to the mcpurge command