Class PlayerCache

java.lang.Object
com.zenith.cache.data.PlayerCache
All Implemented Interfaces:
CachedData

public class PlayerCache extends Object implements CachedData
  • Field Details

    • hardcore

      protected boolean hardcore
    • reducedDebugInfo

      protected boolean reducedDebugInfo
    • maxPlayers

      protected int maxPlayers
    • enableRespawnScreen

      protected boolean enableRespawnScreen
    • doLimitedCrafting

      protected boolean doLimitedCrafting
    • lastDeathPos

      protected GlobalPos lastDeathPos
    • portalCooldown

      protected int portalCooldown
    • gameMode

      protected GameMode gameMode
    • heldItemSlot

      protected int heldItemSlot
    • thePlayer

      protected EntityPlayer thePlayer
    • inventoryCache

      protected final InventoryCache inventoryCache
    • entityCache

      protected final EntityCache entityCache
    • difficulty

      protected Difficulty 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

      protected EntityEvent opLevel
    • actionId

      protected AtomicInteger actionId
    • seqId

      protected AtomicInteger seqId
    • spawnPosition

      protected MutableVec3i spawnPosition
    • teleportQueue

      protected Queue<ClientboundPlayerPositionPacket> teleportQueue
    • keepAliveQueue

      protected Queue<PlayerCache.KeepAliveRequest> keepAliveQueue
    • pingQueue

      protected Queue<PlayerCache.PingRequest> pingQueue
    • respawning

      protected boolean respawning
  • Constructor Details

    • PlayerCache

      public PlayerCache(EntityCache entityCache)
  • Method Details

    • getPackets

      public void getPackets(@NonNull Consumer<Packet> consumer, @NonNull TcpSession session)
      Specified by:
      getPackets in interface CachedData
    • reset

      public void reset(CacheResetType type)
      Specified by:
      reset in interface CachedData
    • getSendingMessage

      public String getSendingMessage()
      Specified by:
      getSendingMessage in interface CachedData
    • inventorySync

      public static void inventorySync()
    • isAlive

      public boolean isAlive()
    • setInventory

      public void setInventory(int containerId, ItemStack[] inventory)
    • getEquipment

      public ItemStack getEquipment(EquipmentSlot slot)
    • getEquipment

      public ItemStack getEquipment(Hand hand)
    • getEquipment

      public Map<EquipmentSlot, ItemStack> getEquipment()
    • setInventorySlot

      public void setInventorySlot(int containerId, ItemStack newItemStack, int slot)
    • getX

      public double getX()
    • setX

      public PlayerCache setX(double x)
    • getY

      public double getY()
    • getEyeY

      public double getEyeY()
    • setY

      public PlayerCache setY(double y)
    • getZ

      public double getZ()
    • setZ

      public PlayerCache setZ(double z)
    • getYaw

      public float getYaw()
    • setYaw

      public PlayerCache setYaw(float yaw)
    • getPitch

      public float getPitch()
    • setPitch

      public PlayerCache setPitch(float pitch)
    • getVelX

      public double getVelX()
    • setVelX

      public PlayerCache setVelX(double velX)
    • getVelY

      public double getVelY()
    • setVelY

      public PlayerCache setVelY(double velY)
    • getVelZ

      public double getVelZ()
    • setVelZ

      public PlayerCache setVelZ(double velZ)
    • getEntityId

      public int getEntityId()
    • setEntityId

      public PlayerCache setEntityId(int id)
    • setUuid

      public PlayerCache setUuid(UUID uuid)
    • distanceSqToSelf

      public double distanceSqToSelf(Entity entity)
    • closeContainer

      public void closeContainer(int containerId)
    • openContainer

      public void openContainer(int containerId, ContainerType type, net.kyori.adventure.text.Component title)
    • getPlayerInventory

      public List<ItemStack> getPlayerInventory()
    • isHardcore

      public boolean isHardcore()
    • isReducedDebugInfo

      public boolean isReducedDebugInfo()
    • getMaxPlayers

      public int getMaxPlayers()
    • isEnableRespawnScreen

      public boolean isEnableRespawnScreen()
    • isDoLimitedCrafting

      public boolean isDoLimitedCrafting()
    • getLastDeathPos

      public GlobalPos getLastDeathPos()
    • getPortalCooldown

      public int getPortalCooldown()
    • getGameMode

      public GameMode getGameMode()
    • getHeldItemSlot

      public int getHeldItemSlot()
    • getThePlayer

      public EntityPlayer getThePlayer()
    • getInventoryCache

      public InventoryCache getInventoryCache()
    • getEntityCache

      public EntityCache getEntityCache()
    • getDifficulty

      public Difficulty 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

      public EntityEvent getOpLevel()
    • getActionId

      public AtomicInteger getActionId()
    • getSeqId

      public AtomicInteger getSeqId()
    • getSpawnPosition

      public MutableVec3i getSpawnPosition()
    • getTeleportQueue

      public Queue<ClientboundPlayerPositionPacket> getTeleportQueue()
    • getKeepAliveQueue

      public Queue<PlayerCache.KeepAliveRequest> getKeepAliveQueue()
    • getPingQueue

      public Queue<PlayerCache.PingRequest> getPingQueue()
    • isRespawning

      public boolean isRespawning()
    • setHardcore

      public PlayerCache setHardcore(boolean hardcore)
      Returns:
      this.
    • setReducedDebugInfo

      public PlayerCache setReducedDebugInfo(boolean reducedDebugInfo)
      Returns:
      this.
    • setMaxPlayers

      public PlayerCache setMaxPlayers(int maxPlayers)
      Returns:
      this.
    • setEnableRespawnScreen

      public PlayerCache setEnableRespawnScreen(boolean enableRespawnScreen)
      Returns:
      this.
    • setDoLimitedCrafting

      public PlayerCache setDoLimitedCrafting(boolean doLimitedCrafting)
      Returns:
      this.
    • setLastDeathPos

      public PlayerCache setLastDeathPos(GlobalPos lastDeathPos)
      Returns:
      this.
    • setPortalCooldown

      public PlayerCache setPortalCooldown(int portalCooldown)
      Returns:
      this.
    • setGameMode

      public PlayerCache setGameMode(GameMode gameMode)
      Returns:
      this.
    • setHeldItemSlot

      public PlayerCache setHeldItemSlot(int heldItemSlot)
      Returns:
      this.
    • setThePlayer

      public PlayerCache setThePlayer(EntityPlayer thePlayer)
      Returns:
      this.
    • setDifficulty

      public PlayerCache setDifficulty(Difficulty difficulty)
      Returns:
      this.
    • setDifficultyLocked

      public PlayerCache setDifficultyLocked(boolean isDifficultyLocked)
      Returns:
      this.
    • setInvincible

      public PlayerCache setInvincible(boolean invincible)
      Returns:
      this.
    • setCanFly

      public PlayerCache setCanFly(boolean canFly)
      Returns:
      this.
    • setFlying

      public PlayerCache setFlying(boolean flying)
      Returns:
      this.
    • setCreative

      public PlayerCache setCreative(boolean creative)
      Returns:
      this.
    • setFlySpeed

      public PlayerCache setFlySpeed(float flySpeed)
      Returns:
      this.
    • setWalkSpeed

      public PlayerCache setWalkSpeed(float walkSpeed)
      Returns:
      this.
    • setSneaking

      public PlayerCache setSneaking(boolean isSneaking)
      Returns:
      this.
    • setSprinting

      public PlayerCache setSprinting(boolean isSprinting)
      Returns:
      this.
    • setOpLevel

      public PlayerCache setOpLevel(EntityEvent opLevel)
      Returns:
      this.
    • setActionId

      public PlayerCache setActionId(AtomicInteger actionId)
      Returns:
      this.
    • setSeqId

      public PlayerCache setSeqId(AtomicInteger seqId)
      Returns:
      this.
    • setSpawnPosition

      public PlayerCache setSpawnPosition(MutableVec3i spawnPosition)
      Returns:
      this.
    • setTeleportQueue

      public PlayerCache setTeleportQueue(Queue<ClientboundPlayerPositionPacket> teleportQueue)
      Returns:
      this.
    • setKeepAliveQueue

      public PlayerCache setKeepAliveQueue(Queue<PlayerCache.KeepAliveRequest> keepAliveQueue)
      Returns:
      this.
    • setPingQueue

      public PlayerCache setPingQueue(Queue<PlayerCache.PingRequest> pingQueue)
      Returns:
      this.
    • setRespawning

      public PlayerCache setRespawning(boolean respawning)
      Returns:
      this.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object