Remove unneeded permissions class.

This commit is contained in:
drtshock 2015-01-05 10:40:35 -06:00
parent 7b56276c2d
commit f411b4e014

View File

@ -13,14 +13,10 @@ import com.massivecraft.factions.struct.ChatMode;
import com.massivecraft.factions.util.*; import com.massivecraft.factions.util.*;
import com.massivecraft.factions.zcore.MPlugin; import com.massivecraft.factions.zcore.MPlugin;
import com.massivecraft.factions.zcore.util.TextUtil; import com.massivecraft.factions.zcore.util.TextUtil;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.plugin.RegisteredServiceProvider;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.lang.reflect.Type; import java.lang.reflect.Type;
@ -47,8 +43,6 @@ public class P extends MPlugin {
// Persistence related // Persistence related
private boolean locked = false; private boolean locked = false;
public static Permission perms = null;
public boolean getLocked() { public boolean getLocked() {
return this.locked; return this.locked;
} }
@ -73,7 +67,6 @@ public class P extends MPlugin {
this.blockListener = new FactionsBlockListener(this); this.blockListener = new FactionsBlockListener(this);
} }
@Override @Override
public void onEnable() { public void onEnable() {
if (!preEnable()) { if (!preEnable()) {
@ -122,7 +115,6 @@ public class P extends MPlugin {
getServer().getPluginManager().registerEvents(blockListener, this); getServer().getPluginManager().registerEvents(blockListener, this);
saveDefaultConfig(); saveDefaultConfig();
setupPermissions();
// since some other plugins execute commands directly through this command interface, provide it // since some other plugins execute commands directly through this command interface, provide it
this.getCommand(this.refCommand).setExecutor(this); this.getCommand(this.refCommand).setExecutor(this);
@ -131,12 +123,6 @@ public class P extends MPlugin {
this.loadSuccessful = true; this.loadSuccessful = true;
} }
private boolean setupPermissions() {
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
perms = rsp.getProvider();
return perms != null;
}
@Override @Override
public GsonBuilder getGsonBuilder() { public GsonBuilder getGsonBuilder() {
Type mapFLocToStringSetType = new TypeToken<Map<FLocation, Set<String>>>() { Type mapFLocToStringSetType = new TypeToken<Map<FLocation, Set<String>>>() {
@ -323,10 +309,6 @@ public class P extends MPlugin {
return players; return players;
} }
public String getPrimaryGroup(OfflinePlayer player) {
return perms == null ? " " : perms.getPrimaryGroup(Bukkit.getWorlds().get(0).toString(), player);
}
public void debug(Level level, String s) { public void debug(Level level, String s) {
if (getConfig().getBoolean("debug", false)) { if (getConfig().getBoolean("debug", false)) {
getLogger().log(level, s); getLogger().log(level, s);