Record Class SnapshotImpl.Entity

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

public static record SnapshotImpl.Entity(EntityType type, UUID uuid, int id, Pos position, Vec velocity, AtomicReference<InstanceSnapshot> instanceRef, int chunkX, int chunkZ, int[] viewersId, int[] passengersId, int vehicleId, TagReadable tagReadable) extends Record implements EntitySnapshot
  • Constructor Details

    • Entity

      public Entity(EntityType type, UUID uuid, int id, Pos position, Vec velocity, AtomicReference<InstanceSnapshot> instanceRef, int chunkX, int chunkZ, int[] viewersId, int[] passengersId, int vehicleId, TagReadable tagReadable)
      Creates an instance of a Entity record class.
      Parameters:
      type - the value for the type record component
      uuid - the value for the uuid record component
      id - the value for the id record component
      position - the value for the position record component
      velocity - the value for the velocity record component
      instanceRef - the value for the instanceRef record component
      chunkX - the value for the chunkX record component
      chunkZ - the value for the chunkZ record component
      viewersId - the value for the viewersId record component
      passengersId - the value for the passengersId record component
      vehicleId - the value for the vehicleId record component
      tagReadable - the value for the tagReadable record component
  • Method Details

    • 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
    • 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
    • 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 '=='.
      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.
    • type

      public EntityType type()
      Returns the value of the type record component.
      Specified by:
      type in interface EntitySnapshot
      Returns:
      the value of the type record component
    • uuid

      public UUID uuid()
      Returns the value of the uuid record component.
      Specified by:
      uuid in interface EntitySnapshot
      Returns:
      the value of the uuid record component
    • id

      public int id()
      Returns the value of the id record component.
      Specified by:
      id in interface EntitySnapshot
      Returns:
      the value of the id record component
    • position

      public Pos position()
      Returns the value of the position record component.
      Specified by:
      position in interface EntitySnapshot
      Returns:
      the value of the position record component
    • velocity

      public Vec velocity()
      Returns the value of the velocity record component.
      Specified by:
      velocity in interface EntitySnapshot
      Returns:
      the value of the velocity record component
    • instanceRef

      public AtomicReference<InstanceSnapshot> instanceRef()
      Returns the value of the instanceRef record component.
      Returns:
      the value of the instanceRef record component
    • chunkX

      public int chunkX()
      Returns the value of the chunkX record component.
      Returns:
      the value of the chunkX record component
    • chunkZ

      public int chunkZ()
      Returns the value of the chunkZ record component.
      Returns:
      the value of the chunkZ record component
    • viewersId

      public int[] viewersId()
      Returns the value of the viewersId record component.
      Returns:
      the value of the viewersId record component
    • passengersId

      public int[] passengersId()
      Returns the value of the passengersId record component.
      Returns:
      the value of the passengersId record component
    • vehicleId

      public int vehicleId()
      Returns the value of the vehicleId record component.
      Returns:
      the value of the vehicleId record component
    • tagReadable

      public TagReadable tagReadable()
      Returns the value of the tagReadable record component.
      Returns:
      the value of the tagReadable record component