crwdns19325:0crwdne19325:0

crwdns19326:0:javadoc:crwdnd19326:0:javadoc:crwdne19326:0

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

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

crwdns19327:0crwdne19327:0

crwdns19328:0crwdne19328:0

crwdns19329:0crwdne19329:0

crwdns19330:0crwdne19330:0

import org.spongepowered.api.profile.GameProfile;

import java.util.concurrent.CompletableFuture;

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

crwdns19331:0crwdne19331:0

import java.util.UUID;

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

Tip

crwdns19332:0:javadoc:crwdnd19332:0:javadoc:crwdne19332:0

crwdns19333:0crwdne19333:0

crwdns19334:0crwdne19334:0

GameProfile gameProfile = futureGameProfile.get();

Warning

crwdns19335:0crwdne19335:0

crwdns19336:0crwdne19336:0

crwdns19337:0:javadoc:crwdne19337:0

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

Note

crwdns19338:0crwdne19338:0

crwdns19339:0crwdne19339:0

crwdns19340:0crwdne19340:0

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

crwdns19341:0crwdne19341:0

crwdns19342:0:javadoc:crwdnd19342:0:javadoc:crwdnd19342:0:javadoc:crwdne19342: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");

crwdns19343:0crwdne19343:0

crwdns19344:0:javadoc:crwdnd19344:0:javadoc:crwdne19344: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

crwdns19345:0:javadoc:crwdne19345:0

crwdns19346:0:javadoc:crwdnd19346:0:javadoc:crwdne19346:0

crwdns19347:0:javadoc:crwdnd19347:0:javadoc:crwdne19347:0