Record Class OfflinePlayerSnapshot

java.lang.Object
java.lang.Record
fr.fidorial.entity.OfflinePlayerSnapshot
Record Components:
uuid - the identity this state belongs to
gameMode - the game mode held at the time of reading
inventory - a detached copy of the player inventory
enderChest - a detached copy of the ender chest
live - true if the state was read from a connected player, false if it was read from storage

public record OfflinePlayerSnapshot(UUID uuid, GameMode gameMode, PlayerInventory inventory, EnderChestInventory enderChest, boolean live) extends Record
The state of a player at the moment it was read.
Since:
0.1.0
  • Constructor Details

    • OfflinePlayerSnapshot

      public OfflinePlayerSnapshot(UUID uuid, GameMode gameMode, PlayerInventory inventory, EnderChestInventory enderChest, boolean live)
      Creates an instance of a OfflinePlayerSnapshot record class.
      Parameters:
      uuid - the value for the uuid record component
      gameMode - the value for the gameMode record component
      inventory - the value for the inventory record component
      enderChest - the value for the enderChest record component
      live - the value for the live 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 the compare method from their corresponding wrapper classes.
      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.
    • uuid

      public UUID uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • gameMode

      public GameMode gameMode()
      Returns the value of the gameMode record component.
      Returns:
      the value of the gameMode record component
    • inventory

      public PlayerInventory inventory()
      Returns the value of the inventory record component.
      Returns:
      the value of the inventory record component
    • enderChest

      public EnderChestInventory enderChest()
      Returns the value of the enderChest record component.
      Returns:
      the value of the enderChest record component
    • live

      public boolean live()
      Returns the value of the live record component.
      Returns:
      the value of the live record component