Record Class SnapshotImpl.Instance

java.lang.Object
java.lang.Record
net.minestom.server.snapshot.SnapshotImpl.Instance
All Implemented Interfaces:
Block.Getter, InstanceSnapshot, Snapshot, TagReadable, Biome.Getter
Enclosing class:
SnapshotImpl

public static record SnapshotImpl.Instance(AtomicReference<ServerSnapshot> serverRef, DimensionType dimensionType, long worldAge, long time, Map<Long,AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable) extends Record implements InstanceSnapshot
  • Constructor Details

    • Instance

      public Instance(AtomicReference<ServerSnapshot> serverRef, DimensionType dimensionType, long worldAge, long time, Map<Long,AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable)
      Creates an instance of a Instance record class.
      Parameters:
      serverRef - the value for the serverRef record component
      dimensionType - the value for the dimensionType record component
      worldAge - the value for the worldAge record component
      time - the value for the time record component
      chunksMap - the value for the chunksMap record component
      entitiesIds - the value for the entitiesIds record component
      tagReadable - the value for the tagReadable record component
  • Method Details

    • chunk

      @Nullable public @Nullable ChunkSnapshot chunk(int chunkX, int chunkZ)
      Specified by:
      chunk in interface InstanceSnapshot
    • chunks

      @NotNull public @NotNull Collection<@NotNull ChunkSnapshot> chunks()
      Specified by:
      chunks in interface InstanceSnapshot
    • entities

      @NotNull public @NotNull Collection<EntitySnapshot> entities()
      Specified by:
      entities in interface InstanceSnapshot
    • server

      @NotNull public @NotNull ServerSnapshot server()
      Specified by:
      server in interface InstanceSnapshot
    • 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. 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.
    • serverRef

      public AtomicReference<ServerSnapshot> serverRef()
      Returns the value of the serverRef record component.
      Returns:
      the value of the serverRef record component
    • dimensionType

      public DimensionType dimensionType()
      Returns the value of the dimensionType record component.
      Specified by:
      dimensionType in interface InstanceSnapshot
      Returns:
      the value of the dimensionType record component
    • worldAge

      public long worldAge()
      Returns the value of the worldAge record component.
      Specified by:
      worldAge in interface InstanceSnapshot
      Returns:
      the value of the worldAge record component
    • time

      public long time()
      Returns the value of the time record component.
      Specified by:
      time in interface InstanceSnapshot
      Returns:
      the value of the time record component
    • chunksMap

      public Map<Long,AtomicReference<ChunkSnapshot>> chunksMap()
      Returns the value of the chunksMap record component.
      Returns:
      the value of the chunksMap record component
    • entitiesIds

      public int[] entitiesIds()
      Returns the value of the entitiesIds record component.
      Returns:
      the value of the entitiesIds record component
    • tagReadable

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