public class BendingPlayer
extends java.lang.Object
Constructor and Description |
---|
BendingPlayer(java.util.UUID uuid,
java.lang.String playerName,
java.util.ArrayList<Element> elements,
java.util.ArrayList<Element.SubElement> subelements,
java.util.HashMap<java.lang.Integer,java.lang.String> abilities,
boolean permaRemoved)
Creates a new
BendingPlayer . |
Modifier and Type | Method and Description |
---|---|
void |
addCooldown(Ability ability) |
void |
addCooldown(Ability ability,
long cooldown) |
void |
addCooldown(java.lang.String ability,
long cooldown)
Adds an ability to the cooldowns map while firing a
PlayerCooldownChangeEvent . |
void |
addElement(Element element)
Adds an element to the
BendingPlayer 's known list. |
void |
addSubElement(Element.SubElement subelement)
Adds a subelement to the
BendingPlayer 's known list. |
void |
blockChi()
Sets chiBlocked to true.
|
boolean |
canBeBloodbent()
Checks to see if a Player is effected by BloodBending.
|
boolean |
canBend(CoreAbility ability) |
boolean |
canBendIgnoreBinds(CoreAbility ability) |
boolean |
canBendIgnoreBindsCooldowns(CoreAbility ability) |
boolean |
canBendIgnoreCooldowns(CoreAbility ability) |
boolean |
canBendPassive(Element element) |
boolean |
canBeSlowed()
Checks to see if
BendingPlayer can be slowed. |
boolean |
canBind(CoreAbility ability) |
boolean |
canBloodbend()
Checks to see if a player can BloodBend.
|
boolean |
canBloodbendAtAnytime() |
boolean |
canCombustionbend() |
boolean |
canIcebend() |
boolean |
canLavabend()
Checks to see if a player can LavaBend.
|
boolean |
canLightningbend() |
boolean |
canMetalbend()
Checks to see if a player can MetalBend.
|
boolean |
canPlantbend()
Checks to see if a player can PlantBend.
|
boolean |
canSandbend()
Checks to see if a player can SandBend.
|
boolean |
canUseFlight()
Checks to see if a player can use Flight.
|
boolean |
canUseSpiritualProjection()
Checks to see if a player can use SpiritualProjection.
|
boolean |
canUseSubElement(Element.SubElement sub)
Checks to see if a player can bend a specific sub element.
|
boolean |
canWaterHeal()
Checks to see if a player can use Water Healing.
|
java.util.HashMap<java.lang.Integer,java.lang.String> |
getAbilities()
Gets the map of abilities that the
BendingPlayer knows. |
static BendingPlayer |
getBendingPlayer(org.bukkit.OfflinePlayer oPlayer) |
static BendingPlayer |
getBendingPlayer(org.bukkit.entity.Player player) |
static BendingPlayer |
getBendingPlayer(java.lang.String playerName)
Attempts to get a
BendingPlayer from specified player name. |
CoreAbility |
getBoundAbility() |
java.lang.String |
getBoundAbilityName()
Gets the Ability bound to the slot that the player is in.
|
long |
getCooldown(java.lang.String ability)
Gets the cooldown time of the ability.
|
java.util.Map<java.lang.String,java.lang.Long> |
getCooldowns()
Gets the map of cooldowns of the
BendingPlayer . |
java.util.List<Element> |
getElements()
Gets the list of elements the
BendingPlayer knows. |
java.lang.String |
getName()
Gets the name of the
BendingPlayer . |
static java.util.Map<java.util.UUID,BendingPlayer> |
getPlayers()
Gets the map of
BendingPlayer s. |
ChiAbility |
getStance()
Gets the
Chi stance the player is in |
java.util.List<Element.SubElement> |
getSubElements()
Gets the list of subelements the
BendingPlayer knows. |
java.util.UUID |
getUUID()
Gets the unique identifier of the
BendingPlayer . |
java.lang.String |
getUUIDString()
Convenience method to
getUUID() as a string. |
boolean |
hasElement(Element element)
Checks to see if the
BendingPlayer knows a specific element. |
boolean |
hasSubElement(Element.SubElement sub) |
boolean |
hasSubElementPermission(Element.SubElement sub)
Returns whether the player has permission to bend the subelement
|
boolean |
isAvatarState() |
boolean |
isBloodbent() |
boolean |
isChiBlocked()
Checks to see if the
BendingPlayer is chi blocked. |
boolean |
isControlledByMetalClips() |
boolean |
isElementToggled(Element element) |
boolean |
isIlluminating()
Checks if the
BendingPlayer is using illumination. |
boolean |
isOnCooldown(Ability ability) |
boolean |
isOnCooldown(java.lang.String ability)
Checks to see if a specific ability is on cooldown.
|
boolean |
isParalyzed() |
boolean |
isPermaRemoved()
Checks if the
BendingPlayer is permaremoved. |
boolean |
isToggled()
Checks if the
BendingPlayer has bending toggled on. |
boolean |
isTremorSensing()
Checks if the
BendingPlayer is tremor sensing. |
void |
removeCooldown(CoreAbility ability) |
void |
removeCooldown(java.lang.String ability)
Removes the cooldown of an ability.
|
void |
setAbilities(java.util.HashMap<java.lang.Integer,java.lang.String> abilities)
Sets the
BendingPlayer 's abilities. |
void |
setElement(Element element)
Sets the
BendingPlayer 's element. |
void |
setPermaRemoved(boolean permaRemoved)
Sets the permanent removed state of the
BendingPlayer . |
void |
setStance(ChiAbility stance)
Sets the player's
Chi stance |
void |
slow(long cooldown)
Slow the
BendingPlayer for a certain amount of time. |
void |
toggleBending()
Toggles the
BendingPlayer 's bending. |
void |
toggleElement(Element element) |
void |
toggleIllumination()
Toggles the
BendingPlayer 's illumination. |
void |
toggleTremorSense()
Toggles the
BendingPlayer 's tremor sensing. |
void |
unblockChi()
Sets the
BendingPlayer 's chi blocked to false. |
public BendingPlayer(java.util.UUID uuid, java.lang.String playerName, java.util.ArrayList<Element> elements, java.util.ArrayList<Element.SubElement> subelements, java.util.HashMap<java.lang.Integer,java.lang.String> abilities, boolean permaRemoved)
BendingPlayer
.uuid
- The unique identifierplayerName
- The playernameelements
- The known elementsabilities
- The known abilitiespermaRemoved
- The permanent removed statuspublic void addCooldown(Ability ability, long cooldown)
public void addCooldown(Ability ability)
public void addCooldown(java.lang.String ability, long cooldown)
PlayerCooldownChangeEvent
.ability
- Name of the abilitycooldown
- The cooldown timepublic void addElement(Element element)
BendingPlayer
's known list.element
- The element to add.public void addSubElement(Element.SubElement subelement)
BendingPlayer
's known list.subelement
- The subelement to add.public void blockChi()
public boolean canBeBloodbent()
ChiMethods#isChiBlocked(String)
is true public boolean canBend(CoreAbility ability)
public boolean canBendIgnoreBinds(CoreAbility ability)
public boolean canBendIgnoreBindsCooldowns(CoreAbility ability)
public boolean canBendIgnoreCooldowns(CoreAbility ability)
public boolean canBendPassive(Element element)
public boolean canBeSlowed()
BendingPlayer
can be slowed.public boolean canBind(CoreAbility ability)
public boolean canBloodbend()
public boolean canBloodbendAtAnytime()
public boolean canCombustionbend()
public boolean canIcebend()
public boolean canLavabend()
player
- The player to checkpublic boolean canLightningbend()
public boolean canMetalbend()
player
- The player to checkpublic boolean canPlantbend()
player
- The player to checkpublic boolean canSandbend()
player
- The player to checkpublic boolean canUseFlight()
public boolean canUseSpiritualProjection()
player
- The player to checkpublic boolean canWaterHeal()
public boolean canUseSubElement(Element.SubElement sub)
sub
- SubElement to check for.public java.util.HashMap<java.lang.Integer,java.lang.String> getAbilities()
BendingPlayer
knows.public CoreAbility getBoundAbility()
public java.lang.String getBoundAbilityName()
public long getCooldown(java.lang.String ability)
ability
- The ability to checkor -1 if cooldown doesn't exist
public java.util.Map<java.lang.String,java.lang.Long> getCooldowns()
BendingPlayer
.public java.util.List<Element> getElements()
BendingPlayer
knows.public java.lang.String getName()
BendingPlayer
.public ChiAbility getStance()
Chi stance
the player is inpublic java.util.List<Element.SubElement> getSubElements()
BendingPlayer
knows.public java.util.UUID getUUID()
BendingPlayer
.public java.lang.String getUUIDString()
getUUID()
as a string.public boolean hasElement(Element element)
BendingPlayer
knows a specific element.element
- The element to checkpublic boolean hasSubElement(Element.SubElement sub)
public boolean hasSubElementPermission(Element.SubElement sub)
sub
- The SubElementpublic boolean isAvatarState()
public boolean isBloodbent()
public boolean isChiBlocked()
BendingPlayer
is chi blocked.public boolean isControlledByMetalClips()
public boolean isElementToggled(Element element)
public boolean isOnCooldown(Ability ability)
public boolean isOnCooldown(java.lang.String ability)
ability
- The ability name to checkpublic boolean isParalyzed()
public boolean isPermaRemoved()
BendingPlayer
is permaremoved.public boolean isToggled()
BendingPlayer
has bending toggled on.public boolean isTremorSensing()
BendingPlayer
is tremor sensing.public boolean isIlluminating()
BendingPlayer
is using illumination.public void removeCooldown(CoreAbility ability)
public void removeCooldown(java.lang.String ability)
ability
- The ability's cooldown to removepublic void setAbilities(java.util.HashMap<java.lang.Integer,java.lang.String> abilities)
BendingPlayer
's abilities. This method also saves the
abilities to the database.abilities
- The abilities to set/savepublic void setElement(Element element)
BendingPlayer
's element. If the player had elements
before they will be overwritten.e
- The element to setpublic void setPermaRemoved(boolean permaRemoved)
BendingPlayer
.permaRemoved
- public void setStance(ChiAbility stance)
Chi stance
stance
- The player's new stance objectpublic void slow(long cooldown)
BendingPlayer
for a certain amount of time.cooldown
- The amount of time to slow.public void toggleBending()
BendingPlayer
's bending.public void toggleElement(Element element)
public void toggleTremorSense()
BendingPlayer
's tremor sensing.public void toggleIllumination()
BendingPlayer
's illumination.public void unblockChi()
BendingPlayer
's chi blocked to false.public static BendingPlayer getBendingPlayer(org.bukkit.OfflinePlayer oPlayer)
public static BendingPlayer getBendingPlayer(org.bukkit.entity.Player player)
public static BendingPlayer getBendingPlayer(java.lang.String playerName)
BendingPlayer
from specified player name. this
method tries to get a Player
object and gets the uuid and then
calls #getBendingPlayer(UUID)
playerName
- The name of the PlayerPLAYERS
contains the player name#getBendingPlayer(UUID)
public static java.util.Map<java.util.UUID,BendingPlayer> getPlayers()
BendingPlayer
s.PLAYERS