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:
@@ -14,8 +14,6 @@ import net.milkbowl.vault.economy.Economy;
|
|||||||
import net.milkbowl.vault.economy.EconomyResponse;
|
import net.milkbowl.vault.economy.EconomyResponse;
|
||||||
import net.milkbowl.vault.economy.EconomyResponse.ResponseType;
|
import net.milkbowl.vault.economy.EconomyResponse.ResponseType;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
@@ -227,18 +225,6 @@ public class MobArena extends JavaPlugin
|
|||||||
pm.registerEvents(new MAGlobalListener(this, arenaMaster), this);
|
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() {
|
private void setupVault() {
|
||||||
Plugin vaultPlugin = this.getServer().getPluginManager().getPlugin("Vault");
|
Plugin vaultPlugin = this.getServer().getPluginManager().getPlugin("Vault");
|
||||||
if (vaultPlugin == null) {
|
if (vaultPlugin == null) {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class CommandHandler implements CommandExecutor
|
|||||||
CommandInfo info = command.getClass().getAnnotation(CommandInfo.class);
|
CommandInfo info = command.getClass().getAnnotation(CommandInfo.class);
|
||||||
|
|
||||||
// First check if the sender has permission.
|
// 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);
|
am.getGlobalMessenger().tell(sender, Msg.MISC_NO_ACCESS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ public class CommandHandler implements CommandExecutor
|
|||||||
*/
|
*/
|
||||||
private void showUsage(Command cmd, CommandSender sender, boolean prefix) {
|
private void showUsage(Command cmd, CommandSender sender, boolean prefix) {
|
||||||
CommandInfo info = cmd.getClass().getAnnotation(CommandInfo.class);
|
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());
|
sender.sendMessage((prefix ? "Usage: " : "") + info.usage() + " " + ChatColor.YELLOW + info.desc());
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ public class CommandHandler implements CommandExecutor
|
|||||||
|
|
||||||
for (Command cmd : commands.values()) {
|
for (Command cmd : commands.values()) {
|
||||||
CommandInfo info = cmd.getClass().getAnnotation(CommandInfo.class);
|
CommandInfo info = cmd.getClass().getAnnotation(CommandInfo.class);
|
||||||
if (!plugin.has(sender, info.permission())) continue;
|
if (!sender.hasPermission(info.permission())) continue;
|
||||||
|
|
||||||
StringBuilder buffy;
|
StringBuilder buffy;
|
||||||
if (info.permission().startsWith("mobarena.admin")) {
|
if (info.permission().startsWith("mobarena.admin")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user