Class WrappedPlayer
java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.util.implementations.WrappedPlayer
- All Implemented Interfaces:
IMessageable, IPlayer, ICommandSender
-
Constructor Summary
ConstructorsConstructorDescriptionWrappedPlayer(org.bukkit.entity.Player spigotPlayer, ILocalizer localizer, ITextFactory textFactory) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringasString()Gets the player as a String in the format '"playerName" (playerUUID)'.booleanorg.bukkit.entity.PlayerGets the bukkit player represented by thisIPlayerGets the current location of this player.getName()default longCreates a newPersonalizedLocalizerusing the localizer and locale of this messageable.default PlayerDataGets a thePlayerDatathat represents this player.Gets the text factory of this messageable.getUUID()inthashCode()hasPermission(String permission) Checks if this sender has a given permission.hasPermission(CommandDefinition command) Checks if this sender has a given command.booleanbooleanisOnline()Returns whether this player is online.booleanisOp()voidsendMessage(Text text) Sends a message to this object.toString()Methods inherited from interface IMessageable
newText, sendError, sendInfo, sendMessage, sendSuccessMethods inherited from interface IPlayer
formatCommand, getPlayer, isPlayer
-
Constructor Details
-
WrappedPlayer
@Deprecated public WrappedPlayer(org.bukkit.entity.Player spigotPlayer, ILocalizer localizer, ITextFactory textFactory) Deprecated.UseIPlayerFactoryinstead.Creates a newWrappedPlayerobject.- Parameters:
spigotPlayer- The Spigot player to wrap.localizer- The localizer to use for localization of messages to send to the player.textFactory- The text factory to use for creating text objects.
-
-
Method Details
-
getUUID
-
hasProtectionBypassPermission
public boolean hasProtectionBypassPermission() -
getLocation
Description copied from interface:IPlayerGets the current location of this player.- Specified by:
getLocationin interfaceIPlayer- Returns:
- The current location of this player.
-
hasPermission
Description copied from interface:ICommandSenderChecks if this sender has a given permission.- Specified by:
hasPermissionin interfaceICommandSender- Specified by:
hasPermissionin interfaceIPlayer- Parameters:
permission- The permission node to check.- Returns:
- True if the player has access to the provided permission, otherwise false.
-
hasPermission
Description copied from interface:ICommandSenderChecks if this sender has a given command.Both the user permission (See
CommandDefinition.getUserPermission()) and the admin permission (SeeCommandDefinition.getAdminPermission()) are checked.- Specified by:
hasPermissionin interfaceICommandSender- Specified by:
hasPermissionin interfaceIPlayer- Parameters:
command- TheCommandDefinitionof a command to check.- Returns:
- A
PermissionsStatusthat is true if the player has access to the provided permissions, otherwise false for the user and the admin permission nodes respectively.
-
isOnline
-
getLimit
-
isOp
public boolean isOp() -
getName
-
sendMessage
Description copied from interface:IMessageableSends a message to this object.- Specified by:
sendMessagein interfaceIMessageable- Parameters:
text- The message to send. This may or may not contain formatting.
-
getBukkitPlayer
public org.bukkit.entity.Player getBukkitPlayer()Gets the bukkit player represented by thisIPlayer- Returns:
- The Bukkit player.
-
toString
-
equals
-
hashCode
-
getTextFactory
Description copied from interface:IMessageableGets the text factory of this messageable.- Specified by:
getTextFactoryin interfaceIMessageable- Returns:
- The text factory of this messageable.
-
getPersonalizedLocalizer
Description copied from interface:IMessageableCreates a newPersonalizedLocalizerusing the localizer and locale of this messageable.- Specified by:
getPersonalizedLocalizerin interfaceIMessageable- Returns:
- A new
PersonalizedLocalizerobject.
-
asString
Gets the player as a String in the format '"playerName" (playerUUID)'.- Returns:
- The player as a String.
-
getPlayerData
Gets a thePlayerDatathat represents this player. This may or may not be a new object.- Returns:
- The
PlayerDatathat represents this player.
-
getPermissionsFlag
default long getPermissionsFlag()
-
IPlayerFactoryinstead.