crwdns129027:0crwdne129027:0

crwdns129029:0:javadoc:crwdnd129029:0:javadoc:crwdne129029:0

import org.spongepowered.api.Sponge;
import org.spongepowered.api.profile.GameProfileManager;

GameProfileManager profileManager = Sponge.getServer().getGameProfileManager();

crwdns129031:0crwdne129031:0

crwdns129033:0crwdne129033:0

crwdns129035:0crwdne129035:0

crwdns129037:0crwdne129037:0

import org.spongepowered.api.profile.GameProfile;

import java.util.concurrent.CompletableFuture;

CompletableFuture<GameProfile> futureGameProfile = profileManager.get("Notch");

crwdns129039:0crwdne129039:0

import java.util.UUID;

CompletableFuture<GameProfile> futureGameProfile =
    profileManager.get(UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"));

Tip

crwdns129041:0:javadoc:crwdnd129041:0:javadoc:crwdne129041:0

crwdns129043:0crwdne129043:0

crwdns129045:0crwdne129045:0

GameProfile gameProfile = futureGameProfile.get();

Warning

crwdns129047:0crwdne129047:0

crwdns129049:0crwdne129049:0

crwdns129051:0:javadoc:crwdne129051:0

GameProfile gameProfile = GameProfile.of(
        UUID.fromString("00000000-0000-0000-0000-000000000000"),
        "Herobrine");

Note

crwdns129053:0crwdne129053:0

crwdns129055:0crwdne129055:0

crwdns129057:0crwdne129057:0

GameProfile filledProfile = profileManager.fill(gameProfile).get();

crwdns129059:0crwdne129059:0

crwdns129061:0:javadoc:crwdnd129061:0:javadoc:crwdnd129061:0:javadoc:crwdne129061:0

import org.spongepowered.api.profile.property.ProfileProperty;

import java.util.Collection;

profile.getPropertyMap().put(
    "key", ProfileProperty.of("foo", "bar", null));
Collection<ProfileProperty> customProperties = profile.getPropertyMap().get("key");

crwdns129063:0crwdne129063:0

crwdns129065:0:javadoc:crwdnd129065:0:javadoc:crwdne129065:0

import org.spongepowered.api.profile.GameProfileCache;

GameProfile fakeProfile =
    GameProfile.of(UUID.fromString("00000000-0000-0000-0000-000000000000"),
    "Herobrine");
GameProfileCache cache = profileManager.getCache();
cache.add(profile);

Tip

crwdns129067:0:javadoc:crwdne129067:0

crwdns129069:0:javadoc:crwdnd129069:0:javadoc:crwdne129069:0

crwdns129071:0:javadoc:crwdnd129071:0:javadoc:crwdne129071:0