Search in sources :

Example 1 with UserListWhitelistEntry

use of net.minecraft.server.management.UserListWhitelistEntry in project SpongeCommon by SpongePowered.

the class UserDiscoverer method getFromWhitelist.

private static User getFromWhitelist(UUID uniqueId) {
    GameProfile profile = null;
    UserListWhitelist whiteList = SpongeImpl.getServer().getPlayerList().getWhitelistedPlayers();
    UserListWhitelistEntry whiteListData = whiteList.getEntry(new GameProfile(uniqueId, ""));
    if (whiteListData != null) {
        profile = whiteListData.value;
    }
    if (profile != null) {
        return create(profile);
    }
    return null;
}
Also used : GameProfile(com.mojang.authlib.GameProfile) UserListWhitelist(net.minecraft.server.management.UserListWhitelist) UserListWhitelistEntry(net.minecraft.server.management.UserListWhitelistEntry)

Example 2 with UserListWhitelistEntry

use of net.minecraft.server.management.UserListWhitelistEntry in project SpongeCommon by SpongePowered.

the class SpongeWhitelistService method addProfile.

@Override
public boolean addProfile(GameProfile profile) {
    boolean wasWhitelisted = this.isWhitelisted(profile);
    UserListUtils.addEntry(getWhitelist(), new UserListWhitelistEntry((com.mojang.authlib.GameProfile) profile));
    return wasWhitelisted;
}
Also used : GameProfile(org.spongepowered.api.profile.GameProfile) UserListWhitelistEntry(net.minecraft.server.management.UserListWhitelistEntry)

Aggregations

UserListWhitelistEntry (net.minecraft.server.management.UserListWhitelistEntry)2 GameProfile (com.mojang.authlib.GameProfile)1 UserListWhitelist (net.minecraft.server.management.UserListWhitelist)1 GameProfile (org.spongepowered.api.profile.GameProfile)1