This commit is contained in:
Sleaker 2012-01-19 20:05:08 -08:00
commit 1d021d944d

View File

@ -1,14 +1,11 @@
package net.milkbowl.vault.permission.plugins; package net.milkbowl.vault.permission.plugins;
import java.util.ArrayList; import com.dthielke.starburst.*;
import java.util.List;
import java.util.Set;
import net.milkbowl.vault.Vault; import net.milkbowl.vault.Vault;
import net.milkbowl.vault.permission.Permission; import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.Event.Priority; import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type; import org.bukkit.event.Event.Type;
import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginDisableEvent;
@ -16,11 +13,9 @@ import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.event.server.ServerListener; import org.bukkit.event.server.ServerListener;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import com.dthielke.starburst.Group; import java.util.ArrayList;
import com.dthielke.starburst.GroupManager; import java.util.List;
import com.dthielke.starburst.GroupSet; import java.util.Set;
import com.dthielke.starburst.StarburstPlugin;
import com.dthielke.starburst.User;
public class Permission_Starburst extends Permission { public class Permission_Starburst extends Permission {
private StarburstPlugin perms; private StarburstPlugin perms;
@ -218,6 +213,14 @@ public class Permission_Starburst extends Permission {
@Override @Override
public boolean playerHas(String world, String player, String permission) { public boolean playerHas(String world, String player, String permission) {
OfflinePlayer op = Bukkit.getOfflinePlayer(player); OfflinePlayer op = Bukkit.getOfflinePlayer(player);
if (op.isOnline()) {
Player p = (Player) op;
if (p.getWorld().getName().equalsIgnoreCase(world)) {
return p.hasPermission(permission);
}
}
GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world)); GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
Group user = set.getUser(op); Group user = set.getUser(op);
return user.hasPermission(permission, true); return user.hasPermission(permission, true);