Class BukkitPlayer

java.lang.Object
one.tranic.t.bukkit.player.BukkitPlayer
All Implemented Interfaces:
one.tranic.t.base.player.Player<org.bukkit.entity.Player>

public class BukkitPlayer extends Object implements one.tranic.t.base.player.Player<org.bukkit.entity.Player>
  • Constructor Details

    • BukkitPlayer

      public BukkitPlayer(org.bukkit.entity.Player player)
    • BukkitPlayer

      public BukkitPlayer(org.bukkit.command.CommandSender commandSender)
  • Method Details

    • createPlayer

      @Nullable public static @Nullable BukkitPlayer createPlayer(@Nullable @Nullable org.bukkit.entity.Player player)
      Creates an instance of BukkitPlayer from the given Player instance.
      Parameters:
      player - The player instance to base the BukkitPlayer on. Can be null.
      Returns:
      A new BukkitPlayer instance if the given player is not null, otherwise null.
    • createPlayer

      @Nullable public static @Nullable BukkitPlayer createPlayer(@NotNull @NotNull UUID uuid)
      Creates a BukkitPlayer instance from a UUID.
      Parameters:
      uuid - the unique identifier of the player; must not be null
      Returns:
      a BukkitPlayer instance if a corresponding player is found, or null if no player is found
    • createPlayer

      @Nullable public static @Nullable BukkitPlayer createPlayer(@NotNull @NotNull String username)
      Creates a BukkitPlayer instance for the specified username if the player is found.
      Parameters:
      username - The username of the player to create a BukkitPlayer instance for. Must not be null.
      Returns:
      A BukkitPlayer instance corresponding to the player with the provided username, or null if no player with the given username is found.
    • getUsername

      @NotNull public @NotNull String getUsername()
      Specified by:
      getUsername in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • getUniqueId

      @NotNull public @NotNull UUID getUniqueId()
      Specified by:
      getUniqueId in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • getConnectedHost

      @NotNull public @NotNull String getConnectedHost()
      Specified by:
      getConnectedHost in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • getLocale

      @NotNull public @NotNull Locale getLocale()
      Specified by:
      getLocale in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • getLocation

      @Nullable public @Nullable one.tranic.t.base.player.Location getLocation()
      Specified by:
      getLocation in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • getPing

      public long getPing()
      Specified by:
      getPing in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • isOnline

      public boolean isOnline()
      Specified by:
      isOnline in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • getClientBrand

      @Nullable public @Nullable String getClientBrand()
      Specified by:
      getClientBrand in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • getSourcePlayer

      public org.bukkit.entity.Player getSourcePlayer()
      Specified by:
      getSourcePlayer in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • kick

      public boolean kick()
      Specified by:
      kick in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • kick

      public boolean kick(String reason)
      Specified by:
      kick in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • kick

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

      public void sendMessage(@NotNull @NotNull String message)
      Specified by:
      sendMessage in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>
    • sendMessage

      public void sendMessage(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Specified by:
      sendMessage in interface one.tranic.t.base.player.Player<org.bukkit.entity.Player>