From 98ed75e4e0c8025e2ad970f37320083535f6f62a Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 22 Feb 2012 09:52:58 -0500 Subject: [PATCH] Cleaned up some command issues. Renamed /stats to /mcstats for less plugin conflicts --- .../com/gmail/nossr50/commands/general/StatsCommand.java | 2 +- .../com/gmail/nossr50/commands/mc/McabilityCommand.java | 6 ++++-- src/main/java/com/gmail/nossr50/commands/mc/MccCommand.java | 2 +- src/main/java/com/gmail/nossr50/mcMMO.java | 2 +- src/main/java/com/gmail/nossr50/mcPermissions.java | 5 ++++- src/main/resources/config.yml | 2 +- src/main/resources/plugin.yml | 3 +++ 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/general/StatsCommand.java b/src/main/java/com/gmail/nossr50/commands/general/StatsCommand.java index efca46bd9..6f9bfbddb 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/StatsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/StatsCommand.java @@ -37,7 +37,7 @@ public class StatsCommand implements CommandExecutor { if (!(sender instanceof Player)) { if(args.length != 1) { - sender.sendMessage("Usage: stats "); + sender.sendMessage("Usage: mcstats "); return true; } else { Player temp = plugin.getServer().getPlayer(args[0]); diff --git a/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java index fced60310..af2fcba43 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/McabilityCommand.java @@ -1,11 +1,13 @@ package com.gmail.nossr50.commands.mc; +import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.gmail.nossr50.Users; +import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.locale.mcLocale; @@ -18,8 +20,8 @@ public class McabilityCommand implements CommandExecutor { player = (Player) sender; } - if (player != null && !player.hasPermission("mcmmo.commands.ability")) { - sender.sendMessage("This command requires permissions."); + if (player != null && !mcPermissions.getInstance().mcAbility(player)) { + player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission")); return true; } diff --git a/src/main/java/com/gmail/nossr50/commands/mc/MccCommand.java b/src/main/java/com/gmail/nossr50/commands/mc/MccCommand.java index 204defb78..336370319 100644 --- a/src/main/java/com/gmail/nossr50/commands/mc/MccCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/mc/MccCommand.java @@ -42,7 +42,7 @@ public class MccCommand implements CommandExecutor { player.sendMessage("/ptp " + mcLocale.getString("m.mccPartyTeleport")); } player.sendMessage(mcLocale.getString("m.mccOtherCommands")); - player.sendMessage("/stats " + ChatColor.RED + " " + mcLocale.getString("m.mccStats")); + player.sendMessage("/mcstats " + ChatColor.RED + " " + mcLocale.getString("m.mccStats")); player.sendMessage("/mctop " + ChatColor.RED + mcLocale.getString("m.mccLeaderboards")); if (mcPermissions.getInstance().mySpawn(player)) { diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index ad9506f69..168260eb8 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -317,7 +317,7 @@ public class mcMMO extends JavaPlugin if(LoadProperties.mmoeditEnable) getCommand("mmoedit").setExecutor(new MmoeditCommand(this)); getCommand("mmoupdate").setExecutor(new MmoupdateCommand()); if(LoadProperties.myspawnEnable) getCommand("myspawn").setExecutor(new MyspawnCommand()); - if(LoadProperties.statsEnable) getCommand("stats").setExecutor(new StatsCommand(this)); + if(LoadProperties.statsEnable) getCommand("mcstats").setExecutor(new StatsCommand(this)); if(LoadProperties.whoisEnable) getCommand("whois").setExecutor(new WhoisCommand(this)); if(LoadProperties.xprateEnable) getCommand("xprate").setExecutor(new XprateCommand()); diff --git a/src/main/java/com/gmail/nossr50/mcPermissions.java b/src/main/java/com/gmail/nossr50/mcPermissions.java index 484ab30f4..a3b93278b 100644 --- a/src/main/java/com/gmail/nossr50/mcPermissions.java +++ b/src/main/java/com/gmail/nossr50/mcPermissions.java @@ -47,7 +47,7 @@ public class mcPermissions return player.hasPermission("mcmmo.item.chimaerawing"); } public boolean miningAbility(Player player){ - return player.hasPermission("mcmmo.ability.mining"); + return player.hasPermission("mcmmo.ability.mining"); } public boolean axesAbility(Player player){ return player.hasPermission("mcmmo.ability.axes"); @@ -103,6 +103,9 @@ public class mcPermissions public boolean mining(Player player) { return player.hasPermission("mcmmo.skills.mining"); } + public boolean blastmining(Player player) { + return player.hasPermission("mcmmo.skills.blastmining"); + } public boolean fishing(Player player) { return player.hasPermission("mcmmo.skills.fishing"); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index b97c7e8d6..c85d3a5fa 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1111,7 +1111,7 @@ Commands: Enabled: true accept: Enabled: true - stats: + mcstats: Enabled: true mcability: Enabled: true diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c25279ae0..b495d55f7 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -213,6 +213,7 @@ permissions: mcmmo.skills.swords: true mcmmo.skills.axes: true mcmmo.skills.acrobatics: true + mcmmo.skills.blastmining: true mcmmo.skills.taming: description: mcmmo.skills.mining: @@ -235,3 +236,5 @@ permissions: description: mcmmo.skills.acrobatics: description: + mcmmo.skills.blastmining: + description: