Package de.erethon.dungeonsxl.api.player
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 TypeMethodDescriptionbooleancheckRequirements(Dungeon dungeon)Performs a requirement check for the given dungeon.getGroup()Returns the player's group.List<org.bukkit.inventory.ItemStack>Returns the reward items the player gets after leaving the dungeon.booleanhasPermission(String permission)Checks if the player has the given permission.booleanReturns if the player has any reward items left.booleanReturns if the player is currently breaking a global protection (=using /dxl break).booleanReturns if the player may read messages from the built-in group chat.booleanReturns if the player uses the built-in group chat.voidreset(boolean gameFinished)Respawns the player at the location defined by the game rules or his old position before he was in a dungeon.voidreset(org.bukkit.Location tpLoc, boolean keepInventory)Respawns the player at the given location.default voidsendMessage(String message)Sends a message to the player.voidsetInBreakMode(boolean breakMode)Sets the player into or out of break mode; seeisInBreakMode().voidsetInChatSpyMode(boolean chatSpyMode)Sets if the player may read messages from the built-in group chat.voidsetInGroupChat(boolean groupChat)Sets if the player uses the built-in group chat.voidsetRewardItems(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
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
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; seeisInBreakMode().- Parameters:
breakMode- if the player may break global protections
-
sendMessage
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 respawnkeepInventory- if the saved status shall be reset
-
checkRequirements
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
-