Package net.minestom.server.snapshot
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 net.minestom.server.instance.block.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.@NotNull Collection<@NotNull EntitySnapshot> entities()int[]Returns the value of theentitiesIdsrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull BiomegetBiome(int x, int y, int z) @UnknownNullability BlockgetBlock(int x, int y, int z, @NotNull Block.Getter.Condition condition) <T> @UnknownNullability TReads the specified tag.final inthashCode()Returns a hash code value for this object.@NotNull InstanceSnapshotinstance()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 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.tag.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
public @UnknownNullability Block getBlock(int x, int y, int z, @NotNull @NotNull Block.Getter.Condition condition) - 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
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 '=='. -
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
-