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
ConstructorDescriptionChunk
(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 aChunk
record class. -
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
<Block> Returns the value of theblockEntries
record component.int
chunkX()
Returns the value of thechunkX
record component.int
chunkZ()
Returns the value of thechunkZ
record component.@NotNull Collection
<@NotNull EntitySnapshot> entities()
int[]
Returns the value of theentitiesIds
record component.final boolean
Indicates whether some other object is "equal to" this one.getBiome
(int x, int y, int z) @UnknownNullability Block
getBlock
(int x, int y, int z, @NotNull Block.Getter.Condition condition) <T> @UnknownNullability T
Reads the specified tag.final int
hashCode()
Returns a hash code value for this object.@NotNull InstanceSnapshot
instance()
Returns the value of theinstanceRef
record component.int
Returns the value of theminSection
record component.Section[]
sections()
Returns the value of thesections
record component.Returns the value of thetagReadable
record component.final String
toString()
Returns a string representation of this record class.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.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 aChunk
record class.- Parameters:
minSection
- the value for theminSection
record componentchunkX
- the value for thechunkX
record componentchunkZ
- the value for thechunkZ
record componentsections
- the value for thesections
record componentblockEntries
- the value for theblockEntries
record componententitiesIds
- the value for theentitiesIds
record componentinstanceRef
- the value for theinstanceRef
record componenttagReadable
- the value for thetagReadable
record component
-
-
Method Details
-
getBlock
public @UnknownNullability Block getBlock(int x, int y, int z, @NotNull @NotNull Block.Getter.Condition condition) - Specified by:
getBlock
in interfaceBlock.Getter
-
getBiome
- Specified by:
getBiome
in interfaceBiome.Getter
-
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
-
instance
- Specified by:
instance
in interfaceChunkSnapshot
-
entities
- Specified by:
entities
in 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 theminSection
record component.- Returns:
- the value of the
minSection
record component
-
chunkX
public int chunkX()Returns the value of thechunkX
record component.- Specified by:
chunkX
in interfaceChunkSnapshot
- Returns:
- the value of the
chunkX
record component
-
chunkZ
public int chunkZ()Returns the value of thechunkZ
record component.- Specified by:
chunkZ
in interfaceChunkSnapshot
- Returns:
- the value of the
chunkZ
record component
-
sections
Returns the value of thesections
record component.- Returns:
- the value of the
sections
record component
-
blockEntries
Returns the value of theblockEntries
record component.- Returns:
- the value of the
blockEntries
record component
-
entitiesIds
public int[] entitiesIds()Returns the value of theentitiesIds
record component.- Returns:
- the value of the
entitiesIds
record component
-
instanceRef
Returns the value of theinstanceRef
record component.- Returns:
- the value of the
instanceRef
record component
-
tagReadable
Returns the value of thetagReadable
record component.- Returns:
- the value of the
tagReadable
record component
-