Package one.tranic.t.velocity.player
Class VelocityPlayer
java.lang.Object
one.tranic.t.velocity.player.VelocityPlayer
- All Implemented Interfaces:
one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
public class VelocityPlayer
extends Object
implements one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
Constructor Summary
ConstructorsConstructorDescriptionVelocityPlayer(com.velocitypowered.api.command.CommandSource commandSource) VelocityPlayer(com.velocitypowered.api.proxy.Player player) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable VelocityPlayercreatePlayer(@NotNull String username) Creates aVelocityPlayerinstance from a given username if the player exists.static @Nullable VelocityPlayercreatePlayer(@NotNull UUID uuid) Creates aVelocityPlayerinstance from a specifiedUUID.static @Nullable VelocityPlayercreatePlayer(@Nullable com.velocitypowered.api.proxy.Player player) Creates a new instance ofVelocityPlayerfrom the givenPlayer, or returns null if the input player is null.@Nullable String@NotNull String@NotNull Locale@Nullable one.tranic.t.base.player.LocationlonggetPing()com.velocitypowered.api.proxy.Player@NotNull UUID@NotNull StringbooleanisOnline()booleankick()booleankick(@NotNull net.kyori.adventure.text.Component reason) booleanvoidsendMessage(@NotNull String message) voidsendMessage(@NotNull net.kyori.adventure.text.Component message) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.tranic.t.base.player.Player
getPlayerProtocolVersion, getPlayerVersion, getXUID, isBedrockPlayer, sendForm, sendFormAsync
-
Constructor Details
-
VelocityPlayer
public VelocityPlayer(com.velocitypowered.api.command.CommandSource commandSource) -
VelocityPlayer
public VelocityPlayer(com.velocitypowered.api.proxy.Player player)
-
-
Method Details
-
createPlayer
@Nullable public static @Nullable VelocityPlayer createPlayer(@Nullable @Nullable com.velocitypowered.api.proxy.Player player) Creates a new instance ofVelocityPlayerfrom the givenPlayer, or returns null if the input player is null.- Parameters:
player- the Player instance to create the VelocityPlayer from; may be null- Returns:
- a new VelocityPlayer instance if the player is not null; otherwise null
-
createPlayer
Creates aVelocityPlayerinstance from a specifiedUUID.If the player corresponding to the provided UUID cannot be found on the proxy, the method returns
null.- Parameters:
uuid- the unique identifier of the player, must not benull- Returns:
- a
VelocityPlayerinstance if the player is found, otherwisenull
-
createPlayer
Creates aVelocityPlayerinstance from a given username if the player exists.- Parameters:
username- the username of the player; must not be null- Returns:
- a
VelocityPlayerinstance if the player is found, otherwise null
-
getUsername
- Specified by:
getUsernamein interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
getUniqueId
- Specified by:
getUniqueIdin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
getConnectedHost
- Specified by:
getConnectedHostin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
getLocale
- Specified by:
getLocalein interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
getLocation
@Nullable public @Nullable one.tranic.t.base.player.Location getLocation()- Specified by:
getLocationin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
getPing
public long getPing()- Specified by:
getPingin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
isOnline
public boolean isOnline()- Specified by:
isOnlinein interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
getClientBrand
- Specified by:
getClientBrandin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
getSourcePlayer
public com.velocitypowered.api.proxy.Player getSourcePlayer()- Specified by:
getSourcePlayerin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
kick
public boolean kick()- Specified by:
kickin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
kick
- Specified by:
kickin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
kick
public boolean kick(@NotNull @NotNull net.kyori.adventure.text.Component reason) - Specified by:
kickin interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
sendMessage
- Specified by:
sendMessagein interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-
sendMessage
public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message) - Specified by:
sendMessagein interfaceone.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
-