public abstract class AbstractPlayer extends Object implements Player
Modifier and Type | Field and Description |
---|---|
protected Location |
location |
protected Version |
playerVersion |
protected int |
protocolVersion |
protected Vector |
velocity |
protected CompensatedWorld |
world |
Constructor and Description |
---|
AbstractPlayer() |
Modifier and Type | Method and Description |
---|---|
void |
applyTheoricVelocity() |
boolean |
equals(Object obj) |
Location |
getLocation()
Get the entity location
|
Version |
getPlayerVersion()
Get player version
(Compatible with ViaVersion and ProtocolSupport for multiple client version)
|
int |
getProtocolVersion() |
List<Block> |
getTargetBlock(int maxDistance) |
Vector |
getVelocity()
Get current entity velocity
|
CompensatedWorld |
getWorld()
Get player world
|
protected void |
init() |
void |
setInternalWorld(CompensatedWorld world)
This does NOT change the platform world (aka teleport)
|
void |
setLocation(Location location) |
void |
setPlayerVersion(Version version) |
void |
setProtocolVersion(int protocolVersion) |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPotionEffect, addPotionEffect, closeInventory, damage, getActivePotionEffect, getAddress, getAllowFlight, getFallDistance, getFlySpeed, getFoodLevel, getGameMode, getHealth, getInventory, getIP, getItemInHand, getItemInOffHand, getLevel, getMaxHealth, getNearbyEntities, getOpenInventory, getPing, getPotionEffect, getServerName, getTheoricVelocity, getVehicle, getWalkSpeed, hasElytra, hasLineOfSight, hasOpenInventory, hasPermission, hasPlayedBefore, hasPotionEffect, hasThorns, isDead, isFlying, isInBoat, isInsideVehicle, isSamePlayer, isSleeping, isSneaking, isSprinting, isSwimming, isUsingRiptide, kick, openInventory, queuePacket, removePotionEffect, sendPacket, sendPluginMessage, sendPluginMessage, sendToServer, setAllowFlight, setFlying, setFoodLevel, setGameMode, setHealth, setSleeping, setSneaking, setSprinting, setVanished, setVelocity, teleport, teleport, updateInventory
getBoundingBox, getEntityId, getEyeHeight, getType, getUniqueId, isOnGround, isOnline, sendMessage
getEyeLocation, getRotation, isOp, isSameId, isSameId, isSameId
getName
getDefault
protected int protocolVersion
protected Version playerVersion
protected Location location
protected Vector velocity
protected CompensatedWorld world
protected void init()
public Version getPlayerVersion()
Player
getPlayerVersion
in interface Player
public void setPlayerVersion(Version version)
setPlayerVersion
in interface Player
public int getProtocolVersion()
getProtocolVersion
in interface Player
public void setProtocolVersion(int protocolVersion)
setProtocolVersion
in interface Player
public Location getLocation()
Entity
getLocation
in interface Entity
getLocation
in interface OfflinePlayer
public void setLocation(Location location)
setLocation
in interface Player
public List<Block> getTargetBlock(int maxDistance)
getTargetBlock
in interface Player
public void applyTheoricVelocity()
applyTheoricVelocity
in interface Player
public Vector getVelocity()
Player
getVelocity
in interface Player
public CompensatedWorld getWorld()
Player
public void setInternalWorld(CompensatedWorld world)
Player
setInternalWorld
in interface Player
world
- the new world