Class PlayerCache
java.lang.Object
com.zenith.cache.data.PlayerCache
- All Implemented Interfaces:
CachedData
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicIntegerprotected booleanprotected booleanprotected booleanprotected Difficultyprotected booleanprotected booleanprotected final EntityCacheprotected booleanprotected floatprotected GameModeprotected booleanprotected intprotected final InventoryCacheprotected booleanprotected booleanprotected booleanprotected booleanprotected Queue<PlayerCache.KeepAliveRequest> protected GlobalPosprotected intprotected EntityEventprotected Queue<PlayerCache.PingRequest> protected intprotected booleanprotected booleanprotected MutableVec3iprotected Queue<ClientboundPlayerPositionPacket> protected EntityPlayerprotected float -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidcloseContainer(int containerId) doubledistanceSqToSelf(Entity entity) booleanintgetEquipment(EquipmentSlot slot) getEquipment(Hand hand) doublegetEyeY()floatintintvoidgetPackets(@NonNull Consumer<Packet> consumer, @NonNull TcpSession session) floatgetPitch()intdoublegetVelX()doublegetVelY()doublegetVelZ()floatdoublegetX()doublegetY()floatgetYaw()doublegetZ()inthashCode()static voidbooleanisAlive()booleanisCanFly()booleanbooleanbooleanbooleanbooleanbooleanisFlying()booleanbooleanbooleanbooleanbooleanbooleanvoidopenContainer(int containerId, ContainerType type, net.kyori.adventure.text.Component title) voidreset(CacheResetType type) setActionId(AtomicInteger actionId) setCanFly(boolean canFly) setClientLoaded(boolean clientLoaded) setCreative(boolean creative) setDifficulty(Difficulty difficulty) setDifficultyLocked(boolean isDifficultyLocked) setDoLimitedCrafting(boolean doLimitedCrafting) setEnableRespawnScreen(boolean enableRespawnScreen) setEntityId(int id) setFlying(boolean flying) setFlySpeed(float flySpeed) setGameMode(GameMode gameMode) setHardcore(boolean hardcore) setHeldItemSlot(int heldItemSlot) voidsetInventory(int containerId, ItemStack[] inventory) voidsetInventorySlot(int containerId, ItemStack newItemStack, int slot) setInvincible(boolean invincible) setKeepAliveQueue(Queue<PlayerCache.KeepAliveRequest> keepAliveQueue) setLastDeathPos(GlobalPos lastDeathPos) setMaxPlayers(int maxPlayers) setOpLevel(EntityEvent opLevel) setPingQueue(Queue<PlayerCache.PingRequest> pingQueue) setPitch(float pitch) setPortalCooldown(int portalCooldown) setReducedDebugInfo(boolean reducedDebugInfo) setRespawning(boolean respawning) setSneaking(boolean isSneaking) setSpawnPosition(MutableVec3i spawnPosition) setSprinting(boolean isSprinting) setTeleportQueue(Queue<ClientboundPlayerPositionPacket> teleportQueue) setThePlayer(EntityPlayer thePlayer) setVelX(double velX) setVelY(double velY) setVelZ(double velZ) setWalkSpeed(float walkSpeed) setX(double x) setY(double y) setYaw(float yaw) setZ(double z) toString()
-
Field Details
-
hardcore
protected boolean hardcore -
reducedDebugInfo
protected boolean reducedDebugInfo -
maxPlayers
protected int maxPlayers -
enableRespawnScreen
protected boolean enableRespawnScreen -
doLimitedCrafting
protected boolean doLimitedCrafting -
lastDeathPos
-
portalCooldown
protected int portalCooldown -
gameMode
-
heldItemSlot
protected int heldItemSlot -
thePlayer
-
inventoryCache
-
entityCache
-
difficulty
-
isDifficultyLocked
protected boolean isDifficultyLocked -
invincible
protected boolean invincible -
canFly
protected boolean canFly -
flying
protected boolean flying -
creative
protected boolean creative -
flySpeed
protected float flySpeed -
walkSpeed
protected float walkSpeed -
isSneaking
protected boolean isSneaking -
isSprinting
protected boolean isSprinting -
opLevel
-
actionId
-
spawnPosition
-
teleportQueue
-
keepAliveQueue
-
pingQueue
-
respawning
protected boolean respawning -
clientLoaded
protected boolean clientLoaded
-
-
Constructor Details
-
PlayerCache
-
-
Method Details
-
getPackets
- Specified by:
getPacketsin interfaceCachedData
-
reset
- Specified by:
resetin interfaceCachedData
-
getSendingMessage
- Specified by:
getSendingMessagein interfaceCachedData
-
inventorySync
public static void inventorySync() -
isAlive
public boolean isAlive() -
setInventory
-
getEquipment
-
getEquipment
-
getEquipment
-
setInventorySlot
-
getX
public double getX() -
setX
-
getY
public double getY() -
getEyeY
public double getEyeY() -
setY
-
getZ
public double getZ() -
setZ
-
getYaw
public float getYaw() -
setYaw
-
getPitch
public float getPitch() -
setPitch
-
getVelX
public double getVelX() -
setVelX
-
getVelY
public double getVelY() -
setVelY
-
getVelZ
public double getVelZ() -
setVelZ
-
getEntityId
public int getEntityId() -
setEntityId
-
setUuid
-
distanceSqToSelf
-
closeContainer
public void closeContainer(int containerId) -
openContainer
public void openContainer(int containerId, ContainerType type, net.kyori.adventure.text.Component title) -
getPlayerInventory
-
isHardcore
public boolean isHardcore() -
isReducedDebugInfo
public boolean isReducedDebugInfo() -
getMaxPlayers
public int getMaxPlayers() -
isEnableRespawnScreen
public boolean isEnableRespawnScreen() -
isDoLimitedCrafting
public boolean isDoLimitedCrafting() -
getLastDeathPos
-
getPortalCooldown
public int getPortalCooldown() -
getGameMode
-
getHeldItemSlot
public int getHeldItemSlot() -
getThePlayer
-
getInventoryCache
-
getEntityCache
-
getDifficulty
-
isDifficultyLocked
public boolean isDifficultyLocked() -
isInvincible
public boolean isInvincible() -
isCanFly
public boolean isCanFly() -
isFlying
public boolean isFlying() -
isCreative
public boolean isCreative() -
getFlySpeed
public float getFlySpeed() -
getWalkSpeed
public float getWalkSpeed() -
isSneaking
public boolean isSneaking() -
isSprinting
public boolean isSprinting() -
getOpLevel
-
getActionId
-
getSpawnPosition
-
getTeleportQueue
-
getKeepAliveQueue
-
getPingQueue
-
isRespawning
public boolean isRespawning() -
isClientLoaded
public boolean isClientLoaded() -
setHardcore
- Returns:
this.
-
setReducedDebugInfo
- Returns:
this.
-
setMaxPlayers
- Returns:
this.
-
setEnableRespawnScreen
- Returns:
this.
-
setDoLimitedCrafting
- Returns:
this.
-
setLastDeathPos
- Returns:
this.
-
setPortalCooldown
- Returns:
this.
-
setGameMode
- Returns:
this.
-
setHeldItemSlot
- Returns:
this.
-
setThePlayer
- Returns:
this.
-
setDifficulty
- Returns:
this.
-
setDifficultyLocked
- Returns:
this.
-
setInvincible
- Returns:
this.
-
setCanFly
- Returns:
this.
-
setFlying
- Returns:
this.
-
setCreative
- Returns:
this.
-
setFlySpeed
- Returns:
this.
-
setWalkSpeed
- Returns:
this.
-
setSneaking
- Returns:
this.
-
setSprinting
- Returns:
this.
-
setOpLevel
- Returns:
this.
-
setActionId
- Returns:
this.
-
setSpawnPosition
- Returns:
this.
-
setTeleportQueue
- Returns:
this.
-
setKeepAliveQueue
- Returns:
this.
-
setPingQueue
- Returns:
this.
-
setRespawning
- Returns:
this.
-
setClientLoaded
- Returns:
this.
-
equals
-
canEqual
-
hashCode
-
toString
-