Record Class PlayerDataStorage.PlayerData
java.lang.Object
java.lang.Record
fr.fidorial.storage.player.PlayerDataStorage.PlayerData
- Record Components:
gameMode- the mode the player left inabilities- the player's movement abilitiesrespawnLocation- the position the player respawns at, ornullfor the world spawnlastLocation- the position the player was last at, ornullif never savedexperience- the experience of the player
- Enclosing interface:
PlayerDataStorage
public static record PlayerDataStorage.PlayerData(GameMode gameMode, PlayerAbilities abilities, @Nullable Location respawnLocation, @Nullable Location lastLocation, PlayerDataStorage.Experience experience)
extends Record
The persisted state of a player.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerData(GameMode gameMode, PlayerAbilities abilities, @Nullable Location respawnLocation, @Nullable Location lastLocation, PlayerDataStorage.Experience experience) Creates an instance of aPlayerDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theabilitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexperiencerecord component.gameMode()Returns the value of thegameModerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelastLocationrecord component.Returns the value of therespawnLocationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlayerData
public PlayerData(GameMode gameMode, PlayerAbilities abilities, @Nullable Location respawnLocation, @Nullable Location lastLocation, PlayerDataStorage.Experience experience) Creates an instance of aPlayerDatarecord class.- Parameters:
gameMode- the value for thegameModerecord componentabilities- the value for theabilitiesrecord componentrespawnLocation- the value for therespawnLocationrecord componentlastLocation- the value for thelastLocationrecord componentexperience- the value for theexperiencerecord component
-
-
Method Details
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
gameMode
-
abilities
-
respawnLocation
Returns the value of therespawnLocationrecord component.- Returns:
- the value of the
respawnLocationrecord component
-
lastLocation
Returns the value of thelastLocationrecord component.- Returns:
- the value of the
lastLocationrecord component
-
experience
Returns the value of theexperiencerecord component.- Returns:
- the value of the
experiencerecord component
-