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, DynamicRegistry.Key<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
ConstructorDescriptionInstance
(AtomicReference<ServerSnapshot> serverRef, DynamicRegistry.Key<DimensionType> dimensionType, long worldAge, long time, Map<Long, AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable) Creates an instance of aInstance
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable ChunkSnapshot
chunk
(int chunkX, int chunkZ) @NotNull Collection
<@NotNull ChunkSnapshot> chunks()
Returns the value of thechunksMap
record component.Returns the value of thedimensionType
record component.@NotNull Collection
<EntitySnapshot> entities()
int[]
Returns the value of theentitiesIds
record component.final boolean
Indicates whether some other object is "equal to" this one.<T> @UnknownNullability T
Reads the specified tag.final int
hashCode()
Returns a hash code value for this object.@NotNull ServerSnapshot
server()
Returns the value of theserverRef
record component.Returns the value of thetagReadable
record component.long
time()
Returns the value of thetime
record component.final String
toString()
Returns a string representation of this record class.long
worldAge()
Returns the value of theworldAge
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minestom.server.world.biome.Biome.Getter
getBiome
Methods inherited from interface net.minestom.server.instance.block.Block.Getter
getBlock, getBlock, getBlock
Methods inherited from interface net.minestom.server.snapshot.InstanceSnapshot
chunkAt, getBiome, getBlock
Methods inherited from interface net.minestom.server.tag.TagReadable
hasTag
-
Constructor Details
-
Instance
public Instance(AtomicReference<ServerSnapshot> serverRef, DynamicRegistry.Key<DimensionType> dimensionType, long worldAge, long time, Map<Long, AtomicReference<ChunkSnapshot>> chunksMap, int[] entitiesIds, TagReadable tagReadable) Creates an instance of aInstance
record class.- Parameters:
serverRef
- the value for theserverRef
record componentdimensionType
- the value for thedimensionType
record componentworldAge
- the value for theworldAge
record componenttime
- the value for thetime
record componentchunksMap
- the value for thechunksMap
record componententitiesIds
- the value for theentitiesIds
record componenttagReadable
- the value for thetagReadable
record component
-
-
Method Details
-
chunk
- Specified by:
chunk
in interfaceInstanceSnapshot
-
chunks
- Specified by:
chunks
in interfaceInstanceSnapshot
-
entities
- Specified by:
entities
in interfaceInstanceSnapshot
-
server
- Specified by:
server
in interfaceInstanceSnapshot
-
getTag
Description copied from interface:TagReadable
Reads the specified tag.- Specified by:
getTag
in 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 theserverRef
record component.- Returns:
- the value of the
serverRef
record component
-
dimensionType
Returns the value of thedimensionType
record component.- Specified by:
dimensionType
in interfaceInstanceSnapshot
- Returns:
- the value of the
dimensionType
record component
-
worldAge
public long worldAge()Returns the value of theworldAge
record component.- Specified by:
worldAge
in interfaceInstanceSnapshot
- Returns:
- the value of the
worldAge
record component
-
time
public long time()Returns the value of thetime
record component.- Specified by:
time
in interfaceInstanceSnapshot
- Returns:
- the value of the
time
record component
-
chunksMap
Returns the value of thechunksMap
record component.- Returns:
- the value of the
chunksMap
record component
-
entitiesIds
public int[] entitiesIds()Returns the value of theentitiesIds
record component.- Returns:
- the value of the
entitiesIds
record component
-
tagReadable
Returns the value of thetagReadable
record component.- Returns:
- the value of the
tagReadable
record component
-