public interface NucleusNicknameService
User
's current nickname.Modifier and Type | Method and Description |
---|---|
Optional<org.spongepowered.api.text.Text> |
getNickname(org.spongepowered.api.entity.living.player.User user)
Gets the current nickname for a user, if it exists.
|
Optional<org.spongepowered.api.text.Text> |
getNicknameWithPrefix(org.spongepowered.api.entity.living.player.User user)
Gets the current nickname for a user with prefix, if it exists.
|
default void |
removeNickname(org.spongepowered.api.entity.living.player.User user)
Removes the nickname for the specified user.
|
default void |
setNickname(org.spongepowered.api.entity.living.player.User user,
org.spongepowered.api.text.Text nickname)
Sets a user's nickname.
|
void |
setNickname(org.spongepowered.api.entity.living.player.User user,
org.spongepowered.api.text.Text nickname,
boolean bypassRestrictions)
Sets a user's nickname.
|
Optional<org.spongepowered.api.text.Text> getNicknameWithPrefix(org.spongepowered.api.entity.living.player.User user)
user
- The User
to inspect.Text
form, if it exists.Optional<org.spongepowered.api.text.Text> getNickname(org.spongepowered.api.entity.living.player.User user)
user
- The User
to inspect.Text
form, if it exists.default void setNickname(org.spongepowered.api.entity.living.player.User user, @Nullable org.spongepowered.api.text.Text nickname) throws NicknameException
user
- The User
to change the nickname ofnickname
- The nickname, or null
to remove it.NicknameException
- if the nickname could not be set.void setNickname(org.spongepowered.api.entity.living.player.User user, @Nullable org.spongepowered.api.text.Text nickname, boolean bypassRestrictions) throws NicknameException
user
- The User
to change the nickname ofnickname
- The nickname, or null
to remove it.bypassRestrictions
- Whether to bypass the configured restrictions.NicknameException
- if the nickname could not be set.default void removeNickname(org.spongepowered.api.entity.living.player.User user) throws NicknameException
user
- The nickname to set.NicknameException
- if the nickname could not be set.