From fe1cf40bbb3b83cfaad5e48dbffd328a180eca5a Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 12 Feb 2013 21:54:38 -0500 Subject: [PATCH] Get rid of unused functions. --- .../gmail/nossr50/commands/CommandHelper.java | 29 ------------------- .../nossr50/commands/player/MctopCommand.java | 5 ++-- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/CommandHelper.java b/src/main/java/com/gmail/nossr50/commands/CommandHelper.java index 3f7c771e2..17a43f283 100644 --- a/src/main/java/com/gmail/nossr50/commands/CommandHelper.java +++ b/src/main/java/com/gmail/nossr50/commands/CommandHelper.java @@ -12,35 +12,6 @@ import com.gmail.nossr50.util.Permissions; public final class CommandHelper { private CommandHelper() {} - /** - * Checks for command permissions. - * - * @param sender The command sender - * @param permission The permission to check - * @return true if the sender is a player without permissions, false otherwise - */ - public static boolean noCommandPermissions(CommandSender sender, String permission) { - if (sender instanceof Player) { - Player player = (Player) sender; - - if (!Permissions.hasPermission(player, permission)) { - player.sendMessage(LocaleLoader.getString("mcMMO.NoPermission")); - return true; - } - } - - return false; - } - - public static boolean noCommandPermissions(Player player, String permission) { - if (!Permissions.hasPermission(player, permission)) { - player.sendMessage(LocaleLoader.getString("mcMMO.NoPermission")); - return true; - } - - return false; - } - public static boolean noConsoleUsage(CommandSender sender) { if (!(sender instanceof Player)) { sender.sendMessage(LocaleLoader.getString("Commands.NoConsole")); diff --git a/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java b/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java index 51165af11..5444567f2 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java @@ -8,7 +8,6 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import com.gmail.nossr50.commands.CommandHelper; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.database.Database; import com.gmail.nossr50.database.Leaderboard; @@ -79,7 +78,7 @@ public class MctopCommand implements CommandExecutor { } private void flatfileDisplay(int page, String skill, CommandSender sender) { - if (!skill.equalsIgnoreCase("all") && CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mctop." + skill.toLowerCase())) { + if (!skill.equalsIgnoreCase("all") && sender.hasPermission("mcmmo.commands.mctop." + skill.toLowerCase())) { return; } @@ -116,7 +115,7 @@ public class MctopCommand implements CommandExecutor { private void sqlDisplay(int page, String query, CommandSender sender) { if (!query.equalsIgnoreCase("taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing")) { - if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mctop." + query.toLowerCase())) { + if (!sender.hasPermission("mcmmo.commands.mctop." + query.toLowerCase())) { return; } }