Record Class SnapshotImpl.Player

java.lang.Object
java.lang.Record
net.minestom.server.snapshot.SnapshotImpl.Player
All Implemented Interfaces:
EntitySnapshot, PlayerSnapshot, Snapshot, TagReadable
Enclosing class:
SnapshotImpl

public static record SnapshotImpl.Player(EntitySnapshot snapshot, String username, GameMode gameMode) extends Record implements PlayerSnapshot
  • Constructor Details

    • Player

      public Player(EntitySnapshot snapshot, String username, GameMode gameMode)
      Creates an instance of a Player record class.
      Parameters:
      snapshot - the value for the snapshot record component
      username - the value for the username record component
      gameMode - the value for the gameMode record component
  • Method Details

    • type

      @NotNull public @NotNull EntityType type()
      Specified by:
      type in interface EntitySnapshot
    • uuid

      @NotNull public @NotNull UUID uuid()
      Specified by:
      uuid in interface EntitySnapshot
    • id

      public int id()
      Specified by:
      id in interface EntitySnapshot
    • position

      @NotNull public @NotNull Pos position()
      Specified by:
      position in interface EntitySnapshot
    • velocity

      @NotNull public @NotNull Vec velocity()
      Specified by:
      velocity in interface EntitySnapshot
    • instance

      @NotNull public @NotNull InstanceSnapshot instance()
      Specified by:
      instance in interface EntitySnapshot
    • chunk

      @NotNull public @NotNull ChunkSnapshot chunk()
      Specified by:
      chunk in interface EntitySnapshot
    • viewers

      @NotNull public @NotNull Collection<@NotNull PlayerSnapshot> viewers()
      Specified by:
      viewers in interface EntitySnapshot
    • passengers

      @NotNull public @NotNull Collection<@NotNull EntitySnapshot> passengers()
      Specified by:
      passengers in interface EntitySnapshot
    • vehicle

      @Nullable public @Nullable EntitySnapshot vehicle()
      Specified by:
      vehicle in interface EntitySnapshot
    • getTag

      public <T> @UnknownNullability T getTag(@NotNull @NotNull Tag<T> tag)
      Description copied from interface: TagReadable
      Reads the specified tag.
      Specified by:
      getTag in interface TagReadable
      Type Parameters:
      T - the tag type
      Parameters:
      tag - the tag to read
      Returns:
      the read tag, null if not present
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • snapshot

      public EntitySnapshot snapshot()
      Returns the value of the snapshot record component.
      Returns:
      the value of the snapshot record component
    • username

      public String username()
      Returns the value of the username record component.
      Specified by:
      username in interface PlayerSnapshot
      Returns:
      the value of the username record component
    • gameMode

      public GameMode gameMode()
      Returns the value of the gameMode record component.
      Specified by:
      gameMode in interface PlayerSnapshot
      Returns:
      the value of the gameMode record component