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 Summary
Nested classes/interfaces inherited from interface net.minestom.server.instance.block.Block.Getter
Block.Getter.Condition -
Constructor Summary
ConstructorsConstructorDescriptionInstance(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 Summary
Modifier 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.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.world.biomes.Biome.Getter
getBiomeMethods inherited from interface net.minestom.server.instance.block.Block.Getter
getBlock, getBlock, getBlockMethods inherited from interface net.minestom.server.snapshot.InstanceSnapshot
chunkAt, getBiome, getBlockMethods inherited from interface net.minestom.server.tag.TagReadable
hasTag
-
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 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
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. -
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. -
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 '=='. -
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
-