Record Class SavedRunStateService.PlayerSnapshot

java.lang.Object
java.lang.Record
dev.deepcore.challenge.session.SavedRunStateService.PlayerSnapshot
Enclosing class:
SavedRunStateService

public static record SavedRunStateService.PlayerSnapshot(String worldName, double x, double y, double z, float yaw, float pitch, double health, double maxHealth, int foodLevel, float saturation, float exhaustion, int fireTicks, int remainingAir, int level, float exp, int totalExperience, String gameMode, boolean allowFlight, boolean flying, org.bukkit.inventory.ItemStack[] storageContents, org.bukkit.inventory.ItemStack[] armorContents, org.bukkit.inventory.ItemStack[] extraContents, List<org.bukkit.potion.PotionEffect> potionEffects) extends Record
Snapshot of a single player's position, inventory, health, and status state.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerSnapshot(String worldName, double x, double y, double z, float yaw, float pitch, double health, double maxHealth, int foodLevel, float saturation, float exhaustion, int fireTicks, int remainingAir, int level, float exp, int totalExperience, String gameMode, boolean allowFlight, boolean flying, org.bukkit.inventory.ItemStack[] storageContents, org.bukkit.inventory.ItemStack[] armorContents, org.bukkit.inventory.ItemStack[] extraContents, List<org.bukkit.potion.PotionEffect> potionEffects)
    Creates an instance of a PlayerSnapshot record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the allowFlight record component.
    org.bukkit.inventory.ItemStack[]
    Returns the value of the armorContents record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    float
    Returns the value of the exhaustion record component.
    float
    exp()
    Returns the value of the exp record component.
    org.bukkit.inventory.ItemStack[]
    Returns the value of the extraContents record component.
    int
    Returns the value of the fireTicks record component.
    boolean
    Returns the value of the flying record component.
    int
    Returns the value of the foodLevel record component.
    Returns the value of the gameMode record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the health record component.
    int
    Returns the value of the level record component.
    double
    Returns the value of the maxHealth record component.
    float
    Returns the value of the pitch record component.
    List<org.bukkit.potion.PotionEffect>
    Returns the value of the potionEffects record component.
    int
    Returns the value of the remainingAir record component.
    float
    Returns the value of the saturation record component.
    org.bukkit.inventory.ItemStack[]
    Returns the value of the storageContents record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the totalExperience record component.
    Returns the value of the worldName record component.
    double
    x()
    Returns the value of the x record component.
    double
    y()
    Returns the value of the y record component.
    float
    yaw()
    Returns the value of the yaw record component.
    double
    z()
    Returns the value of the z record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PlayerSnapshot

      public PlayerSnapshot(String worldName, double x, double y, double z, float yaw, float pitch, double health, double maxHealth, int foodLevel, float saturation, float exhaustion, int fireTicks, int remainingAir, int level, float exp, int totalExperience, String gameMode, boolean allowFlight, boolean flying, org.bukkit.inventory.ItemStack[] storageContents, org.bukkit.inventory.ItemStack[] armorContents, org.bukkit.inventory.ItemStack[] extraContents, List<org.bukkit.potion.PotionEffect> potionEffects)
      Creates an instance of a PlayerSnapshot record class.
      Parameters:
      worldName - the value for the worldName record component
      x - the value for the x record component
      y - the value for the y record component
      z - the value for the z record component
      yaw - the value for the yaw record component
      pitch - the value for the pitch record component
      health - the value for the health record component
      maxHealth - the value for the maxHealth record component
      foodLevel - the value for the foodLevel record component
      saturation - the value for the saturation record component
      exhaustion - the value for the exhaustion record component
      fireTicks - the value for the fireTicks record component
      remainingAir - the value for the remainingAir record component
      level - the value for the level record component
      exp - the value for the exp record component
      totalExperience - the value for the totalExperience record component
      gameMode - the value for the gameMode record component
      allowFlight - the value for the allowFlight record component
      flying - the value for the flying record component
      storageContents - the value for the storageContents record component
      armorContents - the value for the armorContents record component
      extraContents - the value for the extraContents record component
      potionEffects - the value for the potionEffects record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • worldName

      public String worldName()
      Returns the value of the worldName record component.
      Returns:
      the value of the worldName record component
    • x

      public double x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public double y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • z

      public double z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component
    • yaw

      public float yaw()
      Returns the value of the yaw record component.
      Returns:
      the value of the yaw record component
    • pitch

      public float pitch()
      Returns the value of the pitch record component.
      Returns:
      the value of the pitch record component
    • health

      public double health()
      Returns the value of the health record component.
      Returns:
      the value of the health record component
    • maxHealth

      public double maxHealth()
      Returns the value of the maxHealth record component.
      Returns:
      the value of the maxHealth record component
    • foodLevel

      public int foodLevel()
      Returns the value of the foodLevel record component.
      Returns:
      the value of the foodLevel record component
    • saturation

      public float saturation()
      Returns the value of the saturation record component.
      Returns:
      the value of the saturation record component
    • exhaustion

      public float exhaustion()
      Returns the value of the exhaustion record component.
      Returns:
      the value of the exhaustion record component
    • fireTicks

      public int fireTicks()
      Returns the value of the fireTicks record component.
      Returns:
      the value of the fireTicks record component
    • remainingAir

      public int remainingAir()
      Returns the value of the remainingAir record component.
      Returns:
      the value of the remainingAir record component
    • level

      public int level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • exp

      public float exp()
      Returns the value of the exp record component.
      Returns:
      the value of the exp record component
    • totalExperience

      public int totalExperience()
      Returns the value of the totalExperience record component.
      Returns:
      the value of the totalExperience record component
    • gameMode

      public String gameMode()
      Returns the value of the gameMode record component.
      Returns:
      the value of the gameMode record component
    • allowFlight

      public boolean allowFlight()
      Returns the value of the allowFlight record component.
      Returns:
      the value of the allowFlight record component
    • flying

      public boolean flying()
      Returns the value of the flying record component.
      Returns:
      the value of the flying record component
    • storageContents

      public org.bukkit.inventory.ItemStack[] storageContents()
      Returns the value of the storageContents record component.
      Returns:
      the value of the storageContents record component
    • armorContents

      public org.bukkit.inventory.ItemStack[] armorContents()
      Returns the value of the armorContents record component.
      Returns:
      the value of the armorContents record component
    • extraContents

      public org.bukkit.inventory.ItemStack[] extraContents()
      Returns the value of the extraContents record component.
      Returns:
      the value of the extraContents record component
    • potionEffects

      public List<org.bukkit.potion.PotionEffect> potionEffects()
      Returns the value of the potionEffects record component.
      Returns:
      the value of the potionEffects record component