Search in sources :

Example 1 with BannedPlayerList

use of net.minecraft.server.BannedPlayerList in project dynmap by webbukkit.

the class FabricServer method checkPlayerPermissions.

@Override
public Set<String> checkPlayerPermissions(String player, Set<String> perms) {
    PlayerManager scm = server.getPlayerManager();
    if (scm == null)
        return Collections.emptySet();
    BannedPlayerList bl = scm.getUserBanList();
    if (bl == null)
        return Collections.emptySet();
    if (bl.contains(getProfileByName(player))) {
        return Collections.emptySet();
    }
    Set<String> rslt = plugin.hasOfflinePermissions(player, perms);
    if (rslt == null) {
        rslt = new HashSet<String>();
        if (plugin.isOp(player)) {
            rslt.addAll(perms);
        }
    }
    return rslt;
}
Also used : BannedPlayerList(net.minecraft.server.BannedPlayerList) PlayerManager(net.minecraft.server.PlayerManager)

Example 2 with BannedPlayerList

use of net.minecraft.server.BannedPlayerList in project dynmap by webbukkit.

the class FabricServer method checkPlayerPermissions.

@Override
public Set<String> checkPlayerPermissions(String player, Set<String> perms) {
    PlayerManager scm = server.getPlayerManager();
    if (scm == null)
        return Collections.emptySet();
    BannedPlayerList bl = scm.getUserBanList();
    if (bl == null)
        return Collections.emptySet();
    if (bl.contains(getProfileByName(player))) {
        return Collections.emptySet();
    }
    Set<String> rslt = plugin.hasOfflinePermissions(player, perms);
    if (rslt == null) {
        rslt = new HashSet<String>();
        if (plugin.isOp(player)) {
            rslt.addAll(perms);
        }
    }
    return rslt;
}
Also used : BannedPlayerList(net.minecraft.server.BannedPlayerList) PlayerManager(net.minecraft.server.PlayerManager)

Example 3 with BannedPlayerList

use of net.minecraft.server.BannedPlayerList in project dynmap by webbukkit.

the class FabricServer method checkPlayerPermission.

@Override
public boolean checkPlayerPermission(String player, String perm) {
    PlayerManager scm = server.getPlayerManager();
    if (scm == null)
        return false;
    BannedPlayerList bl = scm.getUserBanList();
    if (bl == null)
        return false;
    if (bl.contains(getProfileByName(player))) {
        return false;
    }
    return plugin.hasOfflinePermission(player, perm);
}
Also used : BannedPlayerList(net.minecraft.server.BannedPlayerList) PlayerManager(net.minecraft.server.PlayerManager)

Example 4 with BannedPlayerList

use of net.minecraft.server.BannedPlayerList in project dynmap by webbukkit.

the class FabricServer method checkPlayerPermissions.

@Override
public Set<String> checkPlayerPermissions(String player, Set<String> perms) {
    PlayerManager scm = server.getPlayerManager();
    if (scm == null)
        return Collections.emptySet();
    BannedPlayerList bl = scm.getUserBanList();
    if (bl == null)
        return Collections.emptySet();
    if (bl.contains(getProfileByName(player))) {
        return Collections.emptySet();
    }
    Set<String> rslt = plugin.hasOfflinePermissions(player, perms);
    if (rslt == null) {
        rslt = new HashSet<String>();
        if (plugin.isOp(player)) {
            rslt.addAll(perms);
        }
    }
    return rslt;
}
Also used : BannedPlayerList(net.minecraft.server.BannedPlayerList) PlayerManager(net.minecraft.server.PlayerManager)

Example 5 with BannedPlayerList

use of net.minecraft.server.BannedPlayerList in project dynmap by webbukkit.

the class FabricServer method isPlayerBanned.

@Override
public boolean isPlayerBanned(String pid) {
    PlayerManager scm = server.getPlayerManager();
    BannedPlayerList bl = scm.getUserBanList();
    try {
        return bl.contains(getProfileByName(pid).get());
    } catch (NoSuchElementException e) {
        /* If this profile doesn't exist, default to "banned" for good measure. */
        return true;
    }
}
Also used : BannedPlayerList(net.minecraft.server.BannedPlayerList) PlayerManager(net.minecraft.server.PlayerManager)

Aggregations

BannedPlayerList (net.minecraft.server.BannedPlayerList)9 PlayerManager (net.minecraft.server.PlayerManager)9