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 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 of VelocityPlayer from the given Player, 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

      @Nullable public static @Nullable VelocityPlayer createPlayer(@NotNull @NotNull UUID uuid)
      Creates a VelocityPlayer instance from a specified UUID.

      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 be null
      Returns:
      a VelocityPlayer instance if the player is found, otherwise null
    • createPlayer

      @Nullable public static @Nullable VelocityPlayer createPlayer(@NotNull @NotNull String username)
      Creates a VelocityPlayer instance from a given username if the player exists.
      Parameters:
      username - the username of the player; must not be null
      Returns:
      a VelocityPlayer instance if the player is found, otherwise null
    • getUsername

      @NotNull public @NotNull String getUsername()
      Specified by:
      getUsername in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • getUniqueId

      @NotNull public @NotNull UUID getUniqueId()
      Specified by:
      getUniqueId in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • getConnectedHost

      @NotNull public @NotNull String getConnectedHost()
      Specified by:
      getConnectedHost in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • getLocale

      @NotNull public @NotNull Locale getLocale()
      Specified by:
      getLocale in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • getLocation

      @Nullable public @Nullable one.tranic.t.base.player.Location getLocation()
      Specified by:
      getLocation in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • getPing

      public long getPing()
      Specified by:
      getPing in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • isOnline

      public boolean isOnline()
      Specified by:
      isOnline in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • getClientBrand

      @Nullable public @Nullable String getClientBrand()
      Specified by:
      getClientBrand in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • getSourcePlayer

      public com.velocitypowered.api.proxy.Player getSourcePlayer()
      Specified by:
      getSourcePlayer in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • kick

      public boolean kick()
      Specified by:
      kick in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • kick

      public boolean kick(String reason)
      Specified by:
      kick in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • kick

      public boolean kick(@NotNull @NotNull net.kyori.adventure.text.Component reason)
      Specified by:
      kick in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • sendMessage

      public void sendMessage(@NotNull @NotNull String message)
      Specified by:
      sendMessage in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>
    • sendMessage

      public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Specified by:
      sendMessage in interface one.tranic.t.base.player.Player<com.velocitypowered.api.proxy.Player>