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 saved
- Enclosing interface:
PlayerDataStorage
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerData(GameMode gameMode, PlayerAbilities abilities, @Nullable Location respawnLocation, @Nullable Location lastLocation) 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.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) 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 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
-