Class BukkitPlatformPlayer

java.lang.Object
wtf.choco.veinminer.platform.BukkitPlatformPlayer
All Implemented Interfaces:
PlatformCommandSender, PlatformPlayer

public final class BukkitPlatformPlayer extends Object implements PlatformPlayer
Bukkit implementation of PlatformPlayer.
  • Method Details

    • isOnline

      public boolean isOnline()
      Description copied from interface: PlatformPlayer
      Check whether or not this player is online the server.
      Specified by:
      isOnline in interface PlatformPlayer
      Returns:
      true if online, false if offline
    • getName

      @NotNull public @NotNull String getName()
      Description copied from interface: PlatformCommandSender
      Get the name of this sender.
      Specified by:
      getName in interface PlatformCommandSender
      Returns:
      the name
    • getWorld

      @NotNull public @NotNull BlockAccessor getWorld()
      Description copied from interface: PlatformPlayer
      Get the world in which this player currently resides.
      Specified by:
      getWorld in interface PlatformPlayer
      Returns:
      the world
    • getItemInMainHand

      @NotNull public @NotNull ItemStack getItemInMainHand()
      Description copied from interface: PlatformPlayer
      Get the ItemStack in the player's main hand.
      Specified by:
      getItemInMainHand in interface PlatformPlayer
      Returns:
      the item stack
    • getTargetBlock

      @NotNull public @NotNull RayTraceResult getTargetBlock(int distance)
      Description copied from interface: PlatformPlayer
      Get the block the player is looking at within the given distance. If the player is looking at a block that exceeds the given distance, the result will be empty.
      Specified by:
      getTargetBlock in interface PlatformPlayer
      Parameters:
      distance - the maximum block distance
      Returns:
      the result of the ray trace
    • getUniqueId

      @NotNull public @NotNull UUID getUniqueId()
      Description copied from interface: PlatformPlayer
      Get the UUID of this player.
      Specified by:
      getUniqueId in interface PlatformPlayer
      Returns:
      the uuid
    • sendMessage

      public void sendMessage(@NotNull @NotNull String message)
      Description copied from interface: PlatformCommandSender
      Send a message.
      Specified by:
      sendMessage in interface PlatformCommandSender
      Parameters:
      message - the message to send
    • hasPermission

      public boolean hasPermission(@NotNull @NotNull String permission)
      Description copied from interface: PlatformCommandSender
      Check whether or not this sender has the given permission.
      Specified by:
      hasPermission in interface PlatformCommandSender
      Parameters:
      permission - the permission to check
      Returns:
      true if the sender has the given permission, false otherwise
    • getGameMode

      @NotNull public @NotNull GameMode getGameMode()
      Description copied from interface: PlatformPlayer
      Get the GameMode of this player.
      Specified by:
      getGameMode in interface PlatformPlayer
      Returns:
      the game mode
    • isSneaking

      public boolean isSneaking()
      Description copied from interface: PlatformPlayer
      Check whether or not this player is sneaking.
      Specified by:
      isSneaking in interface PlatformPlayer
      Returns:
      true if sneaking, false otherwise
    • sendPluginMessage

      public void sendPluginMessage(@NotNull @NotNull NamespacedKey channel, byte[] message)
      Description copied from interface: PlatformPlayer
      Send a plugin message to this player over the given channel.
      Specified by:
      sendPluginMessage in interface PlatformPlayer
      Parameters:
      channel - the channel on which to send the message
      message - the message contents
    • kick

      public void kick(@NotNull @NotNull String message)
      Description copied from interface: PlatformPlayer
      Kick this player from the server with the given disconnect message.
      Specified by:
      kick in interface PlatformPlayer
      Parameters:
      message - the disconnect message
    • getPlayer

      @Nullable public @Nullable Player getPlayer()
      Get the Bukkit Player represented by this BukkitPlatformPlayer, or null if the player is not online.
      Returns:
      the player, or null
    • getPlayerOrThrow

      @NotNull public @NotNull Player getPlayerOrThrow()
      Get the Bukkit Player represented by this BukkitPlatformPlayer, or throw an IllegalStateException if the player is not online.
      Returns:
      the player
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object