Package dev.deepcore.challenge.session
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
ConstructorsConstructorDescriptionPlayerSnapshot(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 aPlayerSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowFlightrecord component.org.bukkit.inventory.ItemStack[]Returns the value of thearmorContentsrecord component.final booleanIndicates whether some other object is "equal to" this one.floatReturns the value of theexhaustionrecord component.floatexp()Returns the value of theexprecord component.org.bukkit.inventory.ItemStack[]Returns the value of theextraContentsrecord component.intReturns the value of thefireTicksrecord component.booleanflying()Returns the value of theflyingrecord component.intReturns the value of thefoodLevelrecord component.gameMode()Returns the value of thegameModerecord component.final inthashCode()Returns a hash code value for this object.doublehealth()Returns the value of thehealthrecord component.intlevel()Returns the value of thelevelrecord component.doubleReturns the value of themaxHealthrecord component.floatpitch()Returns the value of thepitchrecord component.List<org.bukkit.potion.PotionEffect> Returns the value of thepotionEffectsrecord component.intReturns the value of theremainingAirrecord component.floatReturns the value of thesaturationrecord component.org.bukkit.inventory.ItemStack[]Returns the value of thestorageContentsrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalExperiencerecord component.Returns the value of theworldNamerecord component.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.floatyaw()Returns the value of theyawrecord component.doublez()Returns the value of thezrecord component.
-
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 aPlayerSnapshotrecord class.- Parameters:
worldName- the value for theworldNamerecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentyaw- the value for theyawrecord componentpitch- the value for thepitchrecord componenthealth- the value for thehealthrecord componentmaxHealth- the value for themaxHealthrecord componentfoodLevel- the value for thefoodLevelrecord componentsaturation- the value for thesaturationrecord componentexhaustion- the value for theexhaustionrecord componentfireTicks- the value for thefireTicksrecord componentremainingAir- the value for theremainingAirrecord componentlevel- the value for thelevelrecord componentexp- the value for theexprecord componenttotalExperience- the value for thetotalExperiencerecord componentgameMode- the value for thegameModerecord componentallowFlight- the value for theallowFlightrecord componentflying- the value for theflyingrecord componentstorageContents- the value for thestorageContentsrecord componentarmorContents- the value for thearmorContentsrecord componentextraContents- the value for theextraContentsrecord componentpotionEffects- the value for thepotionEffectsrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
worldName
Returns the value of theworldNamerecord component.- Returns:
- the value of the
worldNamerecord component
-
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public double z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
yaw
public float yaw()Returns the value of theyawrecord component.- Returns:
- the value of the
yawrecord component
-
pitch
public float pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-
health
public double health()Returns the value of thehealthrecord component.- Returns:
- the value of the
healthrecord component
-
maxHealth
public double maxHealth()Returns the value of themaxHealthrecord component.- Returns:
- the value of the
maxHealthrecord component
-
foodLevel
public int foodLevel()Returns the value of thefoodLevelrecord component.- Returns:
- the value of the
foodLevelrecord component
-
saturation
public float saturation()Returns the value of thesaturationrecord component.- Returns:
- the value of the
saturationrecord component
-
exhaustion
public float exhaustion()Returns the value of theexhaustionrecord component.- Returns:
- the value of the
exhaustionrecord component
-
fireTicks
public int fireTicks()Returns the value of thefireTicksrecord component.- Returns:
- the value of the
fireTicksrecord component
-
remainingAir
public int remainingAir()Returns the value of theremainingAirrecord component.- Returns:
- the value of the
remainingAirrecord component
-
level
public int level()Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
exp
public float exp()Returns the value of theexprecord component.- Returns:
- the value of the
exprecord component
-
totalExperience
public int totalExperience()Returns the value of thetotalExperiencerecord component.- Returns:
- the value of the
totalExperiencerecord component
-
gameMode
Returns the value of thegameModerecord component.- Returns:
- the value of the
gameModerecord component
-
allowFlight
public boolean allowFlight()Returns the value of theallowFlightrecord component.- Returns:
- the value of the
allowFlightrecord component
-
flying
public boolean flying()Returns the value of theflyingrecord component.- Returns:
- the value of the
flyingrecord component
-
storageContents
public org.bukkit.inventory.ItemStack[] storageContents()Returns the value of thestorageContentsrecord component.- Returns:
- the value of the
storageContentsrecord component
-
armorContents
public org.bukkit.inventory.ItemStack[] armorContents()Returns the value of thearmorContentsrecord component.- Returns:
- the value of the
armorContentsrecord component
-
extraContents
public org.bukkit.inventory.ItemStack[] extraContents()Returns the value of theextraContentsrecord component.- Returns:
- the value of the
extraContentsrecord component
-
potionEffects
Returns the value of thepotionEffectsrecord component.- Returns:
- the value of the
potionEffectsrecord component
-