Interface GlobalPlayer

All Superinterfaces:
de.erethon.commons.player.PlayerWrapper
All Known Subinterfaces:
EditPlayer, GamePlayer, InstancePlayer

public interface GlobalPlayer extends de.erethon.commons.player.PlayerWrapper
Represents a player anywhere on the server.

All players on the server, including the ones in dungeons, have one wrapper object that is an instance of GlobalPlayer.

Do not cache this for the whole runtime (or use PlayerCollection). The object may be deleted and replaced with an object of the appropriate type when the player enters or leaves an instance.

Author:
Daniel Saukel
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Performs a requirement check for the given dungeon.
    Returns the player's group.
    List<org.bukkit.inventory.ItemStack>
    Returns the reward items the player gets after leaving the dungeon.
    boolean
    hasPermission​(String permission)
    Checks if the player has the given permission.
    boolean
    Returns if the player has any reward items left.
    boolean
    Returns if the player is currently breaking a global protection (=using /dxl break).
    boolean
    Returns if the player may read messages from the built-in group chat.
    boolean
    Returns if the player uses the built-in group chat.
    void
    reset​(boolean gameFinished)
    Respawns the player at the location defined by the game rules or his old position before he was in a dungeon.
    void
    reset​(org.bukkit.Location tpLoc, boolean keepInventory)
    Respawns the player at the given location.
    default void
    sendMessage​(String message)
    Sends a message to the player.
    void
    setInBreakMode​(boolean breakMode)
    Sets the player into or out of break mode; see isInBreakMode().
    void
    setInChatSpyMode​(boolean chatSpyMode)
    Sets if the player may read messages from the built-in group chat.
    void
    setInGroupChat​(boolean groupChat)
    Sets if the player uses the built-in group chat.
    void
    setRewardItems​(List<org.bukkit.inventory.ItemStack> rewardItems)
    Sets the reward items the player gets after leaving the dungeon.

    Methods inherited from interface de.erethon.commons.player.PlayerWrapper

    getName, getPlayer, getUniqueId
  • Method Details

    • getGroup

      PlayerGroup getGroup()
      Returns the player's group.
      Returns:
      the player's group.
    • isInGroupChat

      boolean isInGroupChat()
      Returns if the player uses the built-in group chat.
      Returns:
      if the player uses the built-in group chat
    • setInGroupChat

      void setInGroupChat(boolean groupChat)
      Sets if the player uses the built-in group chat.
      Parameters:
      groupChat - if the player shall use the built-in group chat
    • isInChatSpyMode

      boolean isInChatSpyMode()
      Returns if the player may read messages from the built-in group chat.
      Returns:
      if the player may read messages from the built-in group chat
    • setInChatSpyMode

      void setInChatSpyMode(boolean chatSpyMode)
      Sets if the player may read messages from the built-in group chat.
      Parameters:
      chatSpyMode - if the player may read messages from the built-in group chat
    • hasPermission

      boolean hasPermission(String permission)
      Checks if the player has the given permission.
      Parameters:
      permission - the permission
      Returns:
      if the player has the given permission
    • getRewardItems

      List<org.bukkit.inventory.ItemStack> getRewardItems()
      Returns the reward items the player gets after leaving the dungeon.
      Returns:
      the reward items the player gets after leaving the dungeon
    • setRewardItems

      void setRewardItems(List<org.bukkit.inventory.ItemStack> rewardItems)
      Sets the reward items the player gets after leaving the dungeon.
      Parameters:
      rewardItems - the reward items the player gets after leaving the dungeon
    • hasRewardItemsLeft

      boolean hasRewardItemsLeft()
      Returns if the player has any reward items left.
      Returns:
      if the player has any reward items left
    • isInBreakMode

      boolean isInBreakMode()
      Returns if the player is currently breaking a global protection (=using /dxl break).
      Returns:
      if the player is currently breaking a global protection (=using /dxl break)
    • setInBreakMode

      void setInBreakMode(boolean breakMode)
      Sets the player into or out of break mode; see isInBreakMode().
      Parameters:
      breakMode - if the player may break global protections
    • sendMessage

      default void sendMessage(String message)
      Sends a message to the player.

      Supports color codes.

      Parameters:
      message - the message to send
    • reset

      void reset(boolean gameFinished)
      Respawns the player at the location defined by the game rules or his old position before he was in a dungeon.
      Parameters:
      gameFinished - if the game was finished
    • reset

      void reset(org.bukkit.Location tpLoc, boolean keepInventory)
      Respawns the player at the given location.
      Parameters:
      tpLoc - the location where the player shall respawn
      keepInventory - if the saved status shall be reset
    • checkRequirements

      boolean checkRequirements(Dungeon dungeon)
      Performs a requirement check for the given dungeon.

      This method might send messages to the player to inform him that he does not fulfill them.

      Parameters:
      dungeon - the dungeon to check
      Returns:
      if the player fulfills the requirements or may bypass them