Record Class SnapshotImpl.Chunk
java.lang.Object
java.lang.Record
net.minestom.server.snapshot.SnapshotImpl.Chunk
- All Implemented Interfaces:
Block.Getter, ChunkSnapshot, Snapshot, TagReadable, Biome.Getter
- Enclosing class:
SnapshotImpl
public static record SnapshotImpl.Chunk(int minSection, int chunkX, int chunkZ, Section[] sections, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<Block> blockEntries, int[] entitiesIds, AtomicReference<InstanceSnapshot> instanceRef, TagReadable tagReadable)
extends Record
implements ChunkSnapshot
-
Nested Class Summary
Nested classes/interfaces inherited from interface Block.Getter
Block.Getter.Condition -
Constructor Summary
ConstructorsConstructorDescriptionChunk(int minSection, int chunkX, int chunkZ, Section[] sections, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<Block> blockEntries, int[] entitiesIds, AtomicReference<InstanceSnapshot> instanceRef, TagReadable tagReadable) Creates an instance of aChunkrecord class. -
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<Block> Returns the value of theblockEntriesrecord component.intchunkX()Returns the value of thechunkXrecord component.intchunkZ()Returns the value of thechunkZrecord component.entities()int[]Returns the value of theentitiesIdsrecord component.final booleanIndicates whether some other object is "equal to" this one.getBiome(int x, int y, int z) getBlock(int x, int y, int z, Block.Getter.Condition condition) <T> @UnknownNullability TReads the specified tag.final inthashCode()Returns a hash code value for this object.instance()Returns the value of theinstanceRefrecord component.intReturns the value of theminSectionrecord component.Section[]sections()Returns the value of thesectionsrecord component.Returns the value of thetagReadablerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Biome.Getter
getBiomeMethods inherited from interface Block.Getter
getBlock, getBlock, getBlockMethods inherited from interface TagReadable
hasTag
-
Constructor Details
-
Chunk
public Chunk(int minSection, int chunkX, int chunkZ, Section[] sections, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<Block> blockEntries, int[] entitiesIds, AtomicReference<InstanceSnapshot> instanceRef, TagReadable tagReadable) Creates an instance of aChunkrecord class.- Parameters:
minSection- the value for theminSectionrecord componentchunkX- the value for thechunkXrecord componentchunkZ- the value for thechunkZrecord componentsections- the value for thesectionsrecord componentblockEntries- the value for theblockEntriesrecord componententitiesIds- the value for theentitiesIdsrecord componentinstanceRef- the value for theinstanceRefrecord componenttagReadable- the value for thetagReadablerecord component
-
-
Method Details
-
getBlock
- Specified by:
getBlockin interfaceBlock.Getter
-
getBiome
- Specified by:
getBiomein interfaceBiome.Getter
-
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
-
instance
- Specified by:
instancein interfaceChunkSnapshot
-
entities
- Specified by:
entitiesin interfaceChunkSnapshot
-
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. -
minSection
public int minSection()Returns the value of theminSectionrecord component.- Returns:
- the value of the
minSectionrecord component
-
chunkX
public int chunkX()Returns the value of thechunkXrecord component.- Specified by:
chunkXin interfaceChunkSnapshot- Returns:
- the value of the
chunkXrecord component
-
chunkZ
public int chunkZ()Returns the value of thechunkZrecord component.- Specified by:
chunkZin interfaceChunkSnapshot- Returns:
- the value of the
chunkZrecord component
-
sections
Returns the value of thesectionsrecord component.- Returns:
- the value of the
sectionsrecord component
-
blockEntries
Returns the value of theblockEntriesrecord component.- Returns:
- the value of the
blockEntriesrecord component
-
entitiesIds
public int[] entitiesIds()Returns the value of theentitiesIdsrecord component.- Returns:
- the value of the
entitiesIdsrecord component
-
instanceRef
Returns the value of theinstanceRefrecord component.- Returns:
- the value of the
instanceRefrecord component
-
tagReadable
Returns the value of thetagReadablerecord component.- Returns:
- the value of the
tagReadablerecord component
-