mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-30 06:33:55 +01:00
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:
parent
94d198c4d0
commit
96af679237
@ -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) {
|
||||
|
@ -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")) {
|
||||
|
Loading…
Reference in New Issue
Block a user