Package net.minestom.server.snapshot
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 
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.minestom.server.instance.block.Block.GetterBlock.Getter.Condition
- 
Constructor SummaryConstructorsConstructorDescriptionInstance(AtomicReference<ServerSnapshot> serverRef, DimensionType dimensionType, long worldAge, long time, Map<Long, AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable) Creates an instance of aInstancerecord class.
- 
Method SummaryModifier and TypeMethodDescription@Nullable ChunkSnapshotchunk(int chunkX, int chunkZ) @NotNull Collection<@NotNull ChunkSnapshot> chunks()Returns the value of thechunksMaprecord component.Returns the value of thedimensionTyperecord component.@NotNull Collection<EntitySnapshot> entities()int[]Returns the value of theentitiesIdsrecord component.final booleanIndicates whether some other object is "equal to" this one.<T> @UnknownNullability TReads the specified tag.final inthashCode()Returns a hash code value for this object.@NotNull ServerSnapshotserver()Returns the value of theserverRefrecord component.Returns the value of thetagReadablerecord component.longtime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.longworldAge()Returns the value of theworldAgerecord component.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.world.biomes.Biome.GettergetBiomeMethods inherited from interface net.minestom.server.instance.block.Block.GettergetBlock, getBlock, getBlockMethods inherited from interface net.minestom.server.snapshot.InstanceSnapshotchunkAt, getBiome, getBlockMethods inherited from interface net.minestom.server.tag.TagReadablehasTag
- 
Constructor Details- 
Instancepublic Instance(AtomicReference<ServerSnapshot> serverRef, DimensionType dimensionType, long worldAge, long time, Map<Long, AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable) Creates an instance of aInstancerecord class.- Parameters:
- serverRef- the value for the- serverRefrecord component
- dimensionType- the value for the- dimensionTyperecord component
- worldAge- the value for the- worldAgerecord component
- time- the value for the- timerecord component
- chunksMap- the value for the- chunksMaprecord component
- entitiesIds- the value for the- entitiesIdsrecord component
- tagReadable- the value for the- tagReadablerecord component
 
 
- 
- 
Method Details- 
chunk- Specified by:
- chunkin interface- InstanceSnapshot
 
- 
chunks- Specified by:
- chunksin interface- InstanceSnapshot
 
- 
entities- Specified by:
- entitiesin interface- InstanceSnapshot
 
- 
server- Specified by:
- serverin interface- InstanceSnapshot
 
- 
getTagDescription copied from interface:TagReadableReads the specified tag.- Specified by:
- getTagin interface- TagReadable
- Type Parameters:
- T- the tag type
- Parameters:
- tag- the tag to read
- Returns:
- the read tag, null if not present
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
serverRefReturns the value of theserverRefrecord component.- Returns:
- the value of the serverRefrecord component
 
- 
dimensionTypeReturns the value of thedimensionTyperecord component.- Specified by:
- dimensionTypein interface- InstanceSnapshot
- Returns:
- the value of the dimensionTyperecord component
 
- 
worldAgepublic long worldAge()Returns the value of theworldAgerecord component.- Specified by:
- worldAgein interface- InstanceSnapshot
- Returns:
- the value of the worldAgerecord component
 
- 
timepublic long time()Returns the value of thetimerecord component.- Specified by:
- timein interface- InstanceSnapshot
- Returns:
- the value of the timerecord component
 
- 
chunksMapReturns the value of thechunksMaprecord component.- Returns:
- the value of the chunksMaprecord component
 
- 
entitiesIdspublic int[] entitiesIds()Returns the value of theentitiesIdsrecord component.- Returns:
- the value of the entitiesIdsrecord component
 
- 
tagReadableReturns the value of thetagReadablerecord component.- Returns:
- the value of the tagReadablerecord component
 
 
-