@ThreadSafe public class OfflinePlayer extends TridentInventoryHolder implements Player
Modifier and Type | Field and Description |
---|---|
protected PlayerAbilities |
abilities |
protected Dimension |
dimension
The dimension of the player
|
protected Inventory |
enderChest |
protected float |
exhaustion
The exaustion of the player
|
protected int |
foodTickTimer
The next ticks that will be run before the player drops in hunger
|
protected GameMode |
gameMode
The gamemode the player is currently in
|
protected short |
hunger
The current hunger of the player
|
protected String |
name
The name of the player
|
protected Set<String> |
permissions |
protected PlayerSpeed |
playerSpeed |
protected float |
saturation
The current food saturation of the player
|
protected int |
score
TODO
|
protected short |
selectedSlot
The current slot selected by the player
|
protected Position |
spawnPosition
The spawn location of the player
|
protected int |
xpLevel
The player's experience level
|
protected float |
xpPercent
The percentage of experience currently in the level
|
protected int |
xpSeed
The experience seed of the player
|
protected int |
xpTotal
The total numerical experience the player has
|
inventory
attributes, canPickup, dead, health, invincibilityTicks, maxHealth, restTicks
airTicks, boundingBox, counter, displayName, executor, fallDistance, fireTicks, godMode, HANDLER, height, id, loc, nameVisible, onGround, passenger, portalCooldown, silent, ticksExisted, uniqueId, velocity, width
Modifier and Type | Method and Description |
---|---|
CompoundTag |
asNbt() |
Player |
asPlayer()
Obtains this command issuer as a player
|
boolean |
connected()
Obtains whether this player is currently on the server or not
|
String |
footer()
Current footer on TAB, returns null if non-existent
|
GameMode |
gameMode()
Returns the GameMode the Player is in
|
static CompoundTag |
generatePlayer(UUID id) |
static OfflinePlayer |
getOfflinePlayer(UUID id) |
void |
grantPermission(String perm)
Offers the permission holder a permission which they can hold
|
String |
header()
Current header on TAB, returns null if non-existent
|
void |
hide(Entity entity)
Makes the specified entity invisible to the current entity
|
void |
invokeCommand(String message)
Issues a command from this sender, forcing them to run it
|
String |
lastCommand()
Gets the last command executed by this CommandIssuer, without the preceding "/"
|
EntityDamageEvent |
lastDamageEvent()
Returns the last EntityDamageEvent which inflicted this Entity
|
String |
lastMessage()
Gets the last message sent to this Messagable
|
Player |
lastPlayerDamager()
Returns the player who dealt damage to this Entity since its last full heal
|
<T extends Projectile> |
launchProjectile(EntityProperties properties)
Launch a projectile based on the given EntityProperties
|
Locale |
locale()
Returns the Player's
Locale settings |
String |
name()
The name of the player, matches that of Mojang servers
|
boolean |
opped()
Checks if the permission holder has operator status
|
boolean |
ownsPermission(String perm)
Observes the holder to see if it holds the specified permission
|
Item |
pickedItem() |
void |
revokePermission(String perm)
Removes the permission tag from the holder such that the next invocation of
PermissionOwner.ownsPermission(String)
returns false |
void |
sendBar(BarType barType,
String s)
Sends a bar accordingly to the type and the message.
|
void |
sendMessage(String message)
Sends the player a message
|
void |
sendRaw(String... messages)
Send an array of messages to this recipient
|
void |
sendTitle(String s)
Sends a regular title
|
void |
sendTitle(String s,
String s1)
Sends a title with a subtitle
|
void |
sendTitle(String s,
String s1,
TitleTransition titleTransition)
Sends a title with a subtitle and a transition
|
void |
sendTitle(String s,
TitleTransition titleTransition)
Sends a regular time with a transition
|
void |
setFooter(MessageBuilder builder) |
void |
setGameMode(GameMode mode)
Sets the player's gamemode to the specified gamemode
|
void |
setHeader(MessageBuilder builder) |
void |
setPickedItem(Item item) |
void |
show(Entity entity)
Un-hides the entity that was hidden from view, or does nothing of already visible
|
Position |
spawnLocation() |
PlayerSpeed |
speedModifiers()
Obtains the settings for the player's speed
|
heldItem, load, selectedSlot, setHeldItem, setSelectedSlot, window
aiHandler, aiModule, canCollectItems, createStatusEffect, doTick, encodeMetadata, headLocation, health, isDead, maxHealth, path, performAiUpdate, remainingAir, remove, setAiModule, setHealth, setMaxHealth, setPath, setRemainingAir
applyProperties, boundingBox, displayName, doEncodeMeta, doLoad, doRemove, eject, entityId, isNameVisible, isSilent, onGround, passenger, position, setDisplayName, setOnGround, setPassenger, setPosition, setSize, setVelocity, spawn, teleport, teleport, teleport, tick, type, uniqueId, velocity, withinRange, world
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aiModule, canCollectItems, createStatusEffect, displayName, headLocation, health, isDead, maxHealth, path, remainingAir, setAiModule, setHealth, setMaxHealth, setPath, setRemainingAir
heldItem, setHeldItem, window
applyProperties, boundingBox, eject, entityId, isNameVisible, isSilent, onGround, passenger, position, remove, setDisplayName, setPassenger, setSize, setVelocity, teleport, teleport, teleport, type, uniqueId, velocity, withinRange, world
protected volatile int score
protected volatile short selectedSlot
protected volatile Position spawnPosition
protected volatile short hunger
protected volatile float exhaustion
protected volatile float saturation
protected volatile int foodTickTimer
protected volatile int xpLevel
protected volatile float xpPercent
protected volatile int xpTotal
protected volatile int xpSeed
protected final Inventory enderChest
protected final PlayerAbilities abilities
protected final PlayerSpeed playerSpeed
protected final Set<String> permissions
public static OfflinePlayer getOfflinePlayer(UUID id)
public static CompoundTag generatePlayer(UUID id)
public Position spawnLocation()
public Locale locale()
Player
Locale
settingspublic GameMode gameMode()
Player
public void setGameMode(GameMode mode)
Player
setGameMode
in interface Player
public PlayerSpeed speedModifiers()
Player
speedModifiers
in interface Player
public void sendMessage(String message)
Player
sendMessage
in interface Player
message
- the message to display to the playerpublic boolean connected()
Player
public void invokeCommand(String message)
CommandIssuer
invokeCommand
in interface CommandIssuer
public String lastCommand()
CommandIssuer
lastCommand
in interface CommandIssuer
public Player asPlayer()
CommandIssuer
asPlayer
in interface CommandIssuer
public void hide(Entity entity)
LivingEntity
Has no effect if the current entity is not a player
hide
in interface LivingEntity
hide
in class TridentLivingEntity
entity
- the entity to make invisible to this entitypublic void show(Entity entity)
LivingEntity
Has no effect if the current entity is not a player
show
in interface LivingEntity
show
in class TridentLivingEntity
entity
- the entity to make visible to this entitypublic EntityDamageEvent lastDamageEvent()
LivingEntity
The event may be cancelled.
lastDamageEvent
in interface LivingEntity
public Player lastPlayerDamager()
LivingEntity
Used for death messages
lastPlayerDamager
in interface LivingEntity
public void sendRaw(String... messages)
Messagable
sendRaw
in interface Messagable
messages
- String[] messages to be sentpublic String lastMessage()
Messagable
lastMessage
in interface Messagable
public String name()
Player
public <T extends Projectile> T launchProjectile(EntityProperties properties)
ProjectileLauncher
launchProjectile
in interface ProjectileLauncher
launchProjectile
in class TridentLivingEntity
public CompoundTag asNbt()
asNbt
in class TridentEntity
public void grantPermission(String perm)
PermissionOwner
This has no effect if the holder already has the given permission
grantPermission
in interface PermissionOwner
perm
- the new permission the holder should holdpublic void revokePermission(String perm)
PermissionOwner
PermissionOwner.ownsPermission(String)
returns false
revokePermission
in interface PermissionOwner
perm
- the permission to removepublic boolean ownsPermission(String perm)
PermissionOwner
ownsPermission
in interface PermissionOwner
perm
- the permission to check if heldtrue
if the permission is held, false
if it is notpublic boolean opped()
PermissionOwner
opped
in interface PermissionOwner
true
to indicate that the holder is an operatorpublic void sendBar(BarType barType, String s)
BarReceiver
sendBar
in interface BarReceiver
barType
- the type of bars
- the message on the barpublic void sendTitle(String s)
TitleReceiver
sendTitle
in interface TitleReceiver
s
- the title messagepublic void sendTitle(String s, String s1)
TitleReceiver
sendTitle
in interface TitleReceiver
s
- the title messages1
- the subtitle messagepublic void sendTitle(String s, TitleTransition titleTransition)
TitleReceiver
sendTitle
in interface TitleReceiver
s
- the title messagetitleTransition
- the transition object for the titlepublic void sendTitle(String s, String s1, TitleTransition titleTransition)
TitleReceiver
sendTitle
in interface TitleReceiver
s
- the title messages1
- the subtitle messagetitleTransition
- the transition object for the titlepublic Item pickedItem()
pickedItem
in interface Player
public void setPickedItem(Item item)
setPickedItem
in interface Player
public String header()
Player
public void setHeader(MessageBuilder builder)
public String footer()
Player
public void setFooter(MessageBuilder builder)
Copyright © 2016. All rights reserved.