Remove obsolete permissions checking on main plugin class.

Originally, the permissions checking was implemented with a dependency on various permissions plugins, but since the introduction of SuperPerms, it hasn't been needed, and this residue is safe to remove.
This commit is contained in:
Andreas Troelsen 2018-04-26 18:31:51 +02:00
parent 94d198c4d0
commit 96af679237
2 changed files with 3 additions and 17 deletions

View File

@ -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) {

View File

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