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, RegistryKey<DimensionType> dimensionType, long worldAge, long time, Map<Long, AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable)
extends Record
implements InstanceSnapshot
-
Nested Class Summary
Nested classes/interfaces inherited from interface Block.Getter
Block.Getter.Condition -
Constructor Summary
ConstructorsConstructorDescriptionInstance(AtomicReference<ServerSnapshot> serverRef, RegistryKey<DimensionType> dimensionType, long worldAge, long time, Map<Long, AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable) Creates an instance of aInstancerecord class. -
Method Summary
Modifier and TypeMethodDescriptionchunk(int chunkX, int chunkZ) chunks()Returns the value of thechunksMaprecord component.Returns the value of thedimensionTyperecord component.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.server()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 interface Biome.Getter
getBiomeMethods inherited from interface Block.Getter
getBlock, getBlock, getBlockMethods inherited from interface InstanceSnapshot
chunkAt, getBiome, getBlockMethods inherited from interface TagReadable
hasTag
-
Constructor Details
-
Instance
public Instance(AtomicReference<ServerSnapshot> serverRef, RegistryKey<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 theserverRefrecord componentdimensionType- the value for thedimensionTyperecord componentworldAge- the value for theworldAgerecord componenttime- the value for thetimerecord componentchunksMap- the value for thechunksMaprecord componententitiesIds- the value for theentitiesIdsrecord componenttagReadable- the value for thetagReadablerecord component
-
-
Method Details
-
chunk
- Specified by:
chunkin interfaceInstanceSnapshot
-
chunks
- Specified by:
chunksin interfaceInstanceSnapshot
-
entities
- Specified by:
entitiesin interfaceInstanceSnapshot
-
server
- Specified by:
serverin interfaceInstanceSnapshot
-
getTag
Description copied from interface:TagReadableReads the specified tag.- Specified by:
getTagin interfaceTagReadable- Type Parameters:
T- the tag type- Parameters:
tag- the tag to read- Returns:
- the read tag, null if not present
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
serverRef
Returns the value of theserverRefrecord component.- Returns:
- the value of the
serverRefrecord component
-
dimensionType
Returns the value of thedimensionTyperecord component.- Specified by:
dimensionTypein interfaceInstanceSnapshot- Returns:
- the value of the
dimensionTyperecord component
-
worldAge
public long worldAge()Returns the value of theworldAgerecord component.- Specified by:
worldAgein interfaceInstanceSnapshot- Returns:
- the value of the
worldAgerecord component
-
time
public long time()Returns the value of thetimerecord component.- Specified by:
timein interfaceInstanceSnapshot- Returns:
- the value of the
timerecord component
-
chunksMap
Returns the value of thechunksMaprecord component.- Returns:
- the value of the
chunksMaprecord component
-
entitiesIds
public int[] entitiesIds()Returns the value of theentitiesIdsrecord component.- Returns:
- the value of the
entitiesIdsrecord component
-
tagReadable
Returns the value of thetagReadablerecord component.- Returns:
- the value of the
tagReadablerecord component
-