AutoReferee  2.5
 All Classes Functions Variables
org.mctourney.autoreferee.AutoRefPlayer Class Reference

Represents a player participating in a match. More...

Inherits org.mctourney.autoreferee.util.Metadatable, and Comparable< AutoRefPlayer >.

Inherited by org.mctourney.autoreferee.AutoRefSpectator.

Public Member Functions

 AutoRefPlayer (String name, AutoRefTeam team)
 Creates a player object for the given player name. More...
 
 AutoRefPlayer (Player player, AutoRefTeam team)
 Creates a player object for the given player. More...
 
 AutoRefPlayer (Player player)
 Creates a player object for the given player. More...
 
void addPoints (AchievementPoints ach, int count)
 Adds achievement points for this player.
 
void addPoints (AchievementPoints ach)
 Adds achievement points for this player.
 
void addPoints (int points)
 Adds achievement points for this player. More...
 
void clearInventory ()
 Clears the contents of this player's inventory.
 
long damageCooldownLength ()
 Gets the number of world ticks since this player was last damaged. More...
 
void die (EntityDamageEvent cause, boolean cleardrops)
 Kills the player. More...
 
String getAccuracy ()
 Gets a string representation of this player's accuracy.
 
Location getBedLocation ()
 Gets location of this player's bed.
 
String getCape ()
 Gets the URL for this player's cape. More...
 
Set< BlockDatagetCarrying ()
 Gets the objectives carried by this player. More...
 
int getDeaths (AutoRefPlayer apl)
 Gets the number of times this player has been killed by a specific player. More...
 
int getDeaths ()
 Gets the number of times this player has died. More...
 
String getDisplayName ()
 Gets name of this player, colored with team colors. More...
 
int getDisplayPoints ()
 Gets the normalized number of achievement points this player has earned. More...
 
Location getExitLocation ()
 Gets the location where this player left their lane. More...
 
String getExtendedAccuracyInfo ()
 Gets a string representation of this player's accuracy. More...
 
double getFurthestShot ()
 Gets the furthest bow shot. More...
 
Inventory getInventoryView ()
 Gets a copy of this player's current inventory. More...
 
Inventory getInventoryView (String name)
 Gets a copy of this player's current inventory. More...
 
int getKDD ()
 Gets the kill-death difference. More...
 
Set< AutoRefPlayergetKillAssists ()
 Gets the players responsible for killing this player. More...
 
AutoRefPlayer getKiller ()
 Gets the player responsible for killing this player. More...
 
int getKills (AutoRefPlayer apl)
 Gets the number of times this player has killed a specific player. More...
 
int getKills ()
 Gets the total number of players killed by this player. More...
 
Location getLastDeathLocation ()
 Gets location of this player's most recent death.
 
Inventory getLastInventoryView ()
 Gets the last saved copy of this player's inventory. More...
 
Location getLastLogoutLocation ()
 Gets location of this player's most recent logout.
 
Location getLastTeleportLocation ()
 Gets location of this player's most recent teleport.
 
Location getLocation ()
 Gets this player's current location. More...
 
AutoRefMatch getMatch ()
 Gets the match this player is in. More...
 
String getName ()
 Gets raw player name. More...
 
Player getPlayer ()
 Retrieves a Player object corresponding to this player. More...
 
int getPoints ()
 Gets the number of achievement points this player has earned. More...
 
int getShotsFired ()
 Gets the number of arrows fired by this player. More...
 
int getShotsHit ()
 Gets the number of arrows this player's arrows that hit a target. More...
 
Location getSpawnLocation ()
 Gets the spawn location for this player. More...
 
int getStreak (AutoRefPlayer apl)
 Gets the number of times this player has consecutively killed another. More...
 
int getStreak ()
 Gets the number of times this player has died in this life. More...
 
AutoRefTeam getTeam ()
 Gets the team this player is on. More...
 
boolean hasBed ()
 Gets whether or not the player has a bed spawn set.
 
boolean hasClientMod ()
 Returns whether or not the player has the AutoReferee client mod installed. More...
 
boolean hasLives ()
 Checks if this player has lives remaining. More...
 
void heal ()
 Heals this player, including health, hunger, saturation, and exhaustion.
 
void incrementShotsFired ()
 Increments the recorded number of arrows fired.
 
void incrementShotsHit ()
 Increments the recorded number of this player's arrows that hit a target.
 
boolean isDead ()
 Checks if the player is dead. More...
 
boolean isDominating (AutoRefPlayer apl)
 Checks if this player is dominating a specified player. More...
 
boolean isOnline ()
 Checks if the player is online. More...
 
boolean isPresent ()
 Checks if this player is in the correct world. More...
 
void resetArrowFire ()
 Resets arrow fire statistics.
 
void resetKillStreak ()
 Resets this player's killstreak.
 
void setCape (String url)
 Sets the URL for this player's cape. More...
 
void setFurthestShot (double distance)
 Sets the furthest accurate bow shot.
 
void setLivesRemaining (int lives)
 Sets the number of lives remaining for this player. More...
 
void setName (String name)
 Sets raw player name.
 
void setSpawnLocation (Location spawn)
 Sets custom spawn location.
 
void setTeam (AutoRefTeam team)
 Sets the team this player is on.
 
boolean showInventory (Player player, boolean old)
 Shows this player's inventory to the specified player. More...
 
boolean showInventory (Player player)
 Shows this player's inventory to the specified player. More...
 
boolean showSavedInventory (Player player)
 Shows this player's last saved inventory to the specified player. More...
 
boolean wasDamagedRecently ()
 Checks if the player has been damaged recently. More...
 

Detailed Description

Represents a player participating in a match.

Author
authorblues

Constructor & Destructor Documentation

org.mctourney.autoreferee.AutoRefPlayer.AutoRefPlayer ( String  name,
AutoRefTeam  team 
)

Creates a player object for the given player name.

Parameters
nameplayer name
teamplayer team, or null if no team
org.mctourney.autoreferee.AutoRefPlayer.AutoRefPlayer ( Player  player,
AutoRefTeam  team 
)

Creates a player object for the given player.

Parameters
playerplayer
teamplayer team, or null if no team
org.mctourney.autoreferee.AutoRefPlayer.AutoRefPlayer ( Player  player)

Creates a player object for the given player.

Parameters
playerplayer

Member Function Documentation

void org.mctourney.autoreferee.AutoRefPlayer.addPoints ( int  points)

Adds achievement points for this player.

This method can be used to add custom point values, if necessary.

long org.mctourney.autoreferee.AutoRefPlayer.damageCooldownLength ( )

Gets the number of world ticks since this player was last damaged.

Returns
ticks since last damage
void org.mctourney.autoreferee.AutoRefPlayer.die ( EntityDamageEvent  cause,
boolean  cleardrops 
)

Kills the player.

If the match has not yet started, the player will be teleported back to spawn.

Parameters
causereported cause of death, or null if no cause
cleardropsclear contents of inventory on death
String org.mctourney.autoreferee.AutoRefPlayer.getCape ( )

Gets the URL for this player's cape.

Returns
cape URL
Set<BlockData> org.mctourney.autoreferee.AutoRefPlayer.getCarrying ( )

Gets the objectives carried by this player.

Returns
set of objectives
int org.mctourney.autoreferee.AutoRefPlayer.getDeaths ( AutoRefPlayer  apl)

Gets the number of times this player has been killed by a specific player.

Parameters
apltarget player
Returns
number of deaths
int org.mctourney.autoreferee.AutoRefPlayer.getDeaths ( )

Gets the number of times this player has died.

Returns
number of deaths
String org.mctourney.autoreferee.AutoRefPlayer.getDisplayName ( )

Gets name of this player, colored with team colors.

Returns
colored name
int org.mctourney.autoreferee.AutoRefPlayer.getDisplayPoints ( )

Gets the normalized number of achievement points this player has earned.

Returns
normalized achievement points
Location org.mctourney.autoreferee.AutoRefPlayer.getExitLocation ( )

Gets the location where this player left their lane.

Returns
exit location
String org.mctourney.autoreferee.AutoRefPlayer.getExtendedAccuracyInfo ( )

Gets a string representation of this player's accuracy.

Includes number of shots fired and the number of hits.

double org.mctourney.autoreferee.AutoRefPlayer.getFurthestShot ( )

Gets the furthest bow shot.

Returns
distance of furthest accurate shot
Inventory org.mctourney.autoreferee.AutoRefPlayer.getInventoryView ( )

Gets a copy of this player's current inventory.

This includes an extra row for armor and health/hunger information.

Returns
inventory view
Inventory org.mctourney.autoreferee.AutoRefPlayer.getInventoryView ( String  name)

Gets a copy of this player's current inventory.

This includes an extra row for armor and health/hunger information.

Returns
inventory view
int org.mctourney.autoreferee.AutoRefPlayer.getKDD ( )

Gets the kill-death difference.

Returns
difference of the kills and deaths
Set<AutoRefPlayer> org.mctourney.autoreferee.AutoRefPlayer.getKillAssists ( )

Gets the players responsible for killing this player.

Returns
killers
AutoRefPlayer org.mctourney.autoreferee.AutoRefPlayer.getKiller ( )

Gets the player responsible for killing this player.

Returns
killer
int org.mctourney.autoreferee.AutoRefPlayer.getKills ( AutoRefPlayer  apl)

Gets the number of times this player has killed a specific player.

Parameters
apltarget player
Returns
number of kills
int org.mctourney.autoreferee.AutoRefPlayer.getKills ( )

Gets the total number of players killed by this player.

Returns
number of kills
Inventory org.mctourney.autoreferee.AutoRefPlayer.getLastInventoryView ( )

Gets the last saved copy of this player's inventory.

If the inventory view is older than a certain age, this method returns null

Returns
inventory view, or null
Location org.mctourney.autoreferee.AutoRefPlayer.getLocation ( )

Gets this player's current location.

Returns
location of player if logged in, otherwise location of last logout
AutoRefMatch org.mctourney.autoreferee.AutoRefPlayer.getMatch ( )

Gets the match this player is in.

Returns
match object
String org.mctourney.autoreferee.AutoRefPlayer.getName ( )

Gets raw player name.

Returns
player name
Player org.mctourney.autoreferee.AutoRefPlayer.getPlayer ( )

Retrieves a Player object corresponding to this player.

Player objects are not cached, since they can log out and log in, so this method will always require a lookup.

Returns
a Player object
int org.mctourney.autoreferee.AutoRefPlayer.getPoints ( )

Gets the number of achievement points this player has earned.

Returns
achievement points
int org.mctourney.autoreferee.AutoRefPlayer.getShotsFired ( )

Gets the number of arrows fired by this player.

Returns
number of arrows fired
int org.mctourney.autoreferee.AutoRefPlayer.getShotsHit ( )

Gets the number of arrows this player's arrows that hit a target.

Returns
number of arrows hit
Location org.mctourney.autoreferee.AutoRefPlayer.getSpawnLocation ( )

Gets the spawn location for this player.

Returns
custom spawn if not on team, otherwise team spawn
int org.mctourney.autoreferee.AutoRefPlayer.getStreak ( AutoRefPlayer  apl)

Gets the number of times this player has consecutively killed another.

This value will reset itself to zero once this player is killed by the target player.

Parameters
apltarget player
Returns
number of consecutive deaths
int org.mctourney.autoreferee.AutoRefPlayer.getStreak ( )

Gets the number of times this player has died in this life.

Returns
number of consecutive deaths
AutoRefTeam org.mctourney.autoreferee.AutoRefPlayer.getTeam ( )

Gets the team this player is on.

Returns
team object
boolean org.mctourney.autoreferee.AutoRefPlayer.hasClientMod ( )

Returns whether or not the player has the AutoReferee client mod installed.

Returns
true if using client mod, otherwise false
boolean org.mctourney.autoreferee.AutoRefPlayer.hasLives ( )

Checks if this player has lives remaining.

Returns
whether player has lives remaining, true if infinite lives
boolean org.mctourney.autoreferee.AutoRefPlayer.isDead ( )

Checks if the player is dead.

Returns
true if player is dead, otherwise false
boolean org.mctourney.autoreferee.AutoRefPlayer.isDominating ( AutoRefPlayer  apl)

Checks if this player is dominating a specified player.

Returns
true if dominating, otherwise false
boolean org.mctourney.autoreferee.AutoRefPlayer.isOnline ( )

Checks if the player is online.

Returns
true if player is online, otherwise false
boolean org.mctourney.autoreferee.AutoRefPlayer.isPresent ( )

Checks if this player is in the correct world.

Returns
true if player is in correct world, otherwise false
void org.mctourney.autoreferee.AutoRefPlayer.setCape ( String  url)

Sets the URL for this player's cape.

This cape can be shown by a modified client only, as Minecraft does not permit custom capes.

Parameters
urlURL of a 64x32 image for the player's cape
void org.mctourney.autoreferee.AutoRefPlayer.setLivesRemaining ( int  lives)

Sets the number of lives remaining for this player.

Parameters
livesnumber of lives remaining before player is eliminated
boolean org.mctourney.autoreferee.AutoRefPlayer.showInventory ( Player  player,
boolean  old 
)

Shows this player's inventory to the specified player.

Returns
true if the inventory can be shown, otherwise false
boolean org.mctourney.autoreferee.AutoRefPlayer.showInventory ( Player  player)

Shows this player's inventory to the specified player.

Returns
true if the inventory can be shown, otherwise false
boolean org.mctourney.autoreferee.AutoRefPlayer.showSavedInventory ( Player  player)

Shows this player's last saved inventory to the specified player.

Returns
true if the inventory can be shown, otherwise false
boolean org.mctourney.autoreferee.AutoRefPlayer.wasDamagedRecently ( )

Checks if the player has been damaged recently.

Returns
true if player was recently damaged, otherwise false

The documentation for this class was generated from the following file: