Package net.draycia.carbon.api.users
Interface UserManager<C extends CarbonPlayer>
@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
public interface UserManager<C extends CarbonPlayer>
Manager used to load/obtain and save
CarbonPlayers.- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncreateParty(Component name) Create a newPartywith the specified name.Look up an existing party by its id.Gets theCarbonPlayerfor the provided playerUUID, whether they are online or not.
-
Method Details
-
user
Gets theCarbonPlayerfor the provided playerUUID, whether they are online or not.Note that the returned user object/future is not guaranteed to be the same for subsequent calls.
Because of this, the return value should not be cached, it should be queried each time it is needed. The implementation handles caching as is appropriate.
- Parameters:
uuid- the player's id- Returns:
- the player
- Since:
- 3.0.0
-
createParty
Create a newPartywith the specified name.Parties with no users will not be saved. Use
Party.disband()to discard.The returned reference will expire after one minute, store
Party.id()rather than the instance and useparty(UUID)to retrieve.- Parameters:
name- party name- Returns:
- new party
- Since:
- 3.0.0
-
party
Look up an existing party by its id.As parties that have never had a user are not saved, they are not retrievable here.
The returned reference will expire after one minute, do not cache it. The implementation handles caching as is appropriate.
- Parameters:
id- party id- Returns:
- existing party
- Since:
- 3.0.0
- See Also:
-