diff --git a/src/main/java/com/garbagemule/MobArena/MobArena.java b/src/main/java/com/garbagemule/MobArena/MobArena.java index dadc68c..0e9d2ca 100644 --- a/src/main/java/com/garbagemule/MobArena/MobArena.java +++ b/src/main/java/com/garbagemule/MobArena/MobArena.java @@ -14,8 +14,6 @@ import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.EconomyResponse; import net.milkbowl.vault.economy.EconomyResponse.ResponseType; import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; -import org.bukkit.command.ConsoleCommandSender; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; @@ -227,18 +225,6 @@ public class MobArena extends JavaPlugin pm.registerEvents(new MAGlobalListener(this, arenaMaster), this); } - // Permissions stuff - public boolean has(Player p, String s) { - return p.hasPermission(s); - } - - public boolean has(CommandSender sender, String s) { - if (sender instanceof ConsoleCommandSender) { - return true; - } - return has((Player) sender, s); - } - private void setupVault() { Plugin vaultPlugin = this.getServer().getPluginManager().getPlugin("Vault"); if (vaultPlugin == null) { diff --git a/src/main/java/com/garbagemule/MobArena/commands/CommandHandler.java b/src/main/java/com/garbagemule/MobArena/commands/CommandHandler.java index 143e6c3..3c7846a 100644 --- a/src/main/java/com/garbagemule/MobArena/commands/CommandHandler.java +++ b/src/main/java/com/garbagemule/MobArena/commands/CommandHandler.java @@ -108,7 +108,7 @@ public class CommandHandler implements CommandExecutor CommandInfo info = command.getClass().getAnnotation(CommandInfo.class); // First check if the sender has permission. - if (!plugin.has(sender, info.permission())) { + if (!sender.hasPermission(info.permission())) { am.getGlobalMessenger().tell(sender, Msg.MISC_NO_ACCESS); return true; } @@ -153,7 +153,7 @@ public class CommandHandler implements CommandExecutor */ private void showUsage(Command cmd, CommandSender sender, boolean prefix) { CommandInfo info = cmd.getClass().getAnnotation(CommandInfo.class); - if (!plugin.has(sender, info.permission())) return; + if (!sender.hasPermission(info.permission())) return; sender.sendMessage((prefix ? "Usage: " : "") + info.usage() + " " + ChatColor.YELLOW + info.desc()); } @@ -179,7 +179,7 @@ public class CommandHandler implements CommandExecutor for (Command cmd : commands.values()) { CommandInfo info = cmd.getClass().getAnnotation(CommandInfo.class); - if (!plugin.has(sender, info.permission())) continue; + if (!sender.hasPermission(info.permission())) continue; StringBuilder buffy; if (info.permission().startsWith("mobarena.admin")) {