crwdns148253:0crwdne148253:0
crwdns148255:0:javadoc:crwdnd148255:0:javadoc:crwdne148255:0
import org.spongepowered.api.Sponge;
import org.spongepowered.api.profile.GameProfileManager;
GameProfileManager profileManager = Sponge.getServer().getGameProfileManager();
crwdns148257:0crwdne148257:0
crwdns148259:0crwdne148259:0
crwdns148261:0crwdne148261:0
crwdns148263:0crwdne148263:0
import org.spongepowered.api.profile.GameProfile;
import java.util.concurrent.CompletableFuture;
CompletableFuture<GameProfile> futureGameProfile = profileManager.get("Notch");
crwdns148265:0crwdne148265:0
import java.util.UUID;
CompletableFuture<GameProfile> futureGameProfile =
profileManager.get(UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"));
Tip
crwdns148267:0:javadoc:crwdnd148267:0:javadoc:crwdne148267:0
crwdns148269:0crwdne148269:0
crwdns148271:0crwdne148271:0
GameProfile gameProfile = futureGameProfile.get();
Warning
crwdns148273:0crwdne148273:0
crwdns148275:0crwdne148275:0
crwdns148277:0:javadoc:crwdne148277:0
GameProfile gameProfile = GameProfile.of(
UUID.fromString("00000000-0000-0000-0000-000000000000"),
"Herobrine");
Note
crwdns148279:0crwdne148279:0
crwdns148281:0crwdne148281:0
crwdns148283:0crwdne148283:0
GameProfile filledProfile = profileManager.fill(gameProfile).get();
crwdns148285:0crwdne148285:0
crwdns148287:0:javadoc:crwdnd148287:0:javadoc:crwdnd148287:0:javadoc:crwdne148287: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");
crwdns148289:0crwdne148289:0
crwdns148291:0:javadoc:crwdnd148291:0:javadoc:crwdne148291: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
crwdns148293:0:javadoc:crwdne148293:0
crwdns148295:0:javadoc:crwdnd148295:0:javadoc:crwdne148295:0
crwdns148297:0:javadoc:crwdnd148297:0:javadoc:crwdne148297:0