Package dev.hypera.chameleon.user
Interface User
-
- All Superinterfaces:
net.kyori.adventure.audience.Audience,ChatUser,net.kyori.adventure.identity.Identified,MetadataHolder,PermissionHolder,net.kyori.adventure.pointer.Pointered
- All Known Subinterfaces:
ProxyUser,ServerUser
@NonExtendable public interface User extends ChatUser, net.kyori.adventure.identity.Identified
Represents a connected Minecraft player.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddisconnect(@NotNull net.kyori.adventure.text.Component reason)Disconnect this user from the platform.@NotNull Optional<SocketAddress>getAddress()Get the address of this user.@NotNull UUIDgetId()Get the unique id representing this user.intgetLatency()Get the latency in milliseconds between this user and the platform.default @NotNull net.kyori.adventure.identity.Identityidentity()Gets the identity.voidsendData(@NotNull String channel, byte[] data)Send a plugin message to this user.-
Methods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
-
Methods inherited from interface dev.hypera.chameleon.user.ChatUser
getName, hasInteractiveChat
-
Methods inherited from interface dev.hypera.chameleon.meta.MetadataHolder
getMetadata, removeMetadata, setDynamicMetadata, setMetadata
-
Methods inherited from interface dev.hypera.chameleon.user.PermissionHolder
hasPermission
-
-
-
-
Method Detail
-
getId
@NotNull @NotNull UUID getId()
Get the unique id representing this user.- Returns:
- user unique id.
-
getAddress
@NotNull @NotNull Optional<SocketAddress> getAddress()
Get the address of this user.- Returns:
- an
Optionalcontaining the address of this user, if available, otherwise an empty optional.
-
getLatency
int getLatency()
Get the latency in milliseconds between this user and the platform.- Returns:
- latency between this user and the platform.
-
sendData
void sendData(@NotNull @NotNull String channel, byte[] data)Send a plugin message to this user.- Parameters:
channel- Plugin message channel.data- Data.
-
disconnect
void disconnect(@NotNull @NotNull net.kyori.adventure.text.Component reason)Disconnect this user from the platform.- Parameters:
reason- Disconnect reason.
-
identity
@NotNull default @NotNull net.kyori.adventure.identity.Identity identity()
Gets the identity.- Specified by:
identityin interfacenet.kyori.adventure.identity.Identified- Returns:
- the identity
-
-