mirror of
https://github.com/MilkBowl/Vault.git
synced 2025-01-17 05:31:25 +01:00
Merge branch 'master' of https://Sleaker@github.com/MilkBowl/Vault.git
This commit is contained in:
commit
1d021d944d
25
src/net/milkbowl/vault/permission/plugins/Permission_Starburst.java
Normal file → Executable file
25
src/net/milkbowl/vault/permission/plugins/Permission_Starburst.java
Normal file → Executable 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;
|
||||||
@ -87,7 +82,7 @@ public class Permission_Starburst extends Permission {
|
|||||||
OfflinePlayer op = Bukkit.getOfflinePlayer(player);
|
OfflinePlayer op = Bukkit.getOfflinePlayer(player);
|
||||||
GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
|
GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
|
||||||
User user = set.getUser(op);
|
User user = set.getUser(op);
|
||||||
|
|
||||||
Set<Group> children = user.getChildren(true);
|
Set<Group> children = user.getChildren(true);
|
||||||
List<String> groups = new ArrayList<String>();
|
List<String> groups = new ArrayList<String>();
|
||||||
for (Group child : children) {
|
for (Group child : children) {
|
||||||
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user