Search in sources :

Example 6 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)

Example 7 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 8 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)

Example 9 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)

Aggregations

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