Get rid of unused functions.

This commit is contained in:
GJ 2013-02-12 21:54:38 -05:00
parent 9be6a7cf3b
commit fe1cf40bbb
2 changed files with 2 additions and 32 deletions

View File

@ -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"));

View File

@ -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;
}
}