Package net.pl3x.map.core.player
Class Player
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.player.Player
Represents a player.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract int
Get the player's current armor points.@NotNull String
Get the player's decorated name.abstract int
Get the player's current healthabstract @NotNull String
getName()
Get the player's name.<T> T
abstract @NotNull Point
Get the player's current position.abstract @Nullable URL
getSkin()
Get the player's skin URL.abstract @NotNull UUID
getUUID()
Get the player's UUID.abstract @NotNull World
getWorld()
Get the world this player is currently in.abstract float
getYaw()
Get the player's current yaw.int
hashCode()
boolean
isHidden()
Get whether player is hidden from the map.abstract boolean
Get whether the player is invisible.abstract boolean
isNPC()
Get whether the player is an NPC.abstract boolean
Get whether the player has hidden flag set persistently.abstract boolean
Get whether the player is in spectator gamemode.void
registerNameDecorator
(int priority, @NotNull BiFunction<@NotNull Player, @NotNull String, @NotNull String> decorator) Function that is used to change player name in a player listvoid
setHidden
(boolean hidden, boolean persistent) Set if the player is hidden from the mapabstract void
setPersistentlyHidden
(boolean hidden) Set whether the player has hidden flag set persistently.void
-
Constructor Details
-
Player
-
-
Method Details
-
getPlayer
@NotNull public <T> T getPlayer() -
setPlayer
-
getName
Get the player's name.- Returns:
- player's name
-
getUUID
Get the player's UUID.- Returns:
- player's UUID
-
getWorld
Get the world this player is currently in.- Returns:
- player's world
-
getPosition
Get the player's current position.- Returns:
- player's position
-
getYaw
public abstract float getYaw()Get the player's current yaw.- Returns:
- player's yaw
-
getHealth
public abstract int getHealth()Get the player's current health- Returns:
- player's health
-
getArmorPoints
public abstract int getArmorPoints()Get the player's current armor points.- Returns:
- player's armor points
-
getSkin
Get the player's skin URL.- Returns:
- player's skin URL
-
isInvisible
public abstract boolean isInvisible()Get whether the player is invisible.- Returns:
- true if player is invisible
-
isNPC
public abstract boolean isNPC()Get whether the player is an NPC.This is for things like the Citizens plugin.
- Returns:
- true if player is an NPC
-
isSpectator
public abstract boolean isSpectator()Get whether the player is in spectator gamemode.- Returns:
- true if player is spectator
-
isHidden
public boolean isHidden()Get whether player is hidden from the map.- Returns:
- true if player is hidden
-
setHidden
public void setHidden(boolean hidden, boolean persistent) Set if the player is hidden from the map- Parameters:
hidden
- True to hide, false to showpersistent
- True to persist this state
-
isPersistentlyHidden
public abstract boolean isPersistentlyHidden()Get whether the player has hidden flag set persistently.- Returns:
- true if player is persistently hidden
-
setPersistentlyHidden
public abstract void setPersistentlyHidden(boolean hidden) Set whether the player has hidden flag set persistently.- Parameters:
hidden
- true to persistently hide player
-
registerNameDecorator
public void registerNameDecorator(int priority, @NotNull @NotNull BiFunction<@NotNull Player, @NotNull String, @NotNull String> decorator) Function that is used to change player name in a player listMultiple decorators can be registered at the same time, in that case the one with Integer.MAX_VALUE will be run as first These two values should be used only in addons that you do not plan to release for public use.
The function takes two arguments - the player and the output of previous decorator
- Parameters:
priority
- Priority of decoratordecorator
- Name decorator to register
-
getDecoratedName
Get the player's decorated name.- Returns:
- decorated name
-
equals
-
hashCode
public int hashCode()
-