Record Class SerializableChunkData
java.lang.Object
java.lang.Record
net.minecraft.world.level.chunk.storage.SerializableChunkData
public record SerializableChunkData(Registry<Biome> biomeRegistry, ChunkPos chunkPos, int minSectionY, long lastUpdateTime, long inhabitedTime, ChunkStatus chunkStatus, @Nullable BlendingData.Packed blendingData, @Nullable BelowZeroRetrogen belowZeroRetrogen, UpgradeData upgradeData, @Nullable long[] carvingMask, Map<Heightmap.Types,long[]> heightmaps, ChunkAccess.PackedTicks packedTicks, it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections, boolean lightCorrect, List<SerializableChunkData.SectionData> sectionData, List<CompoundTag> entities, List<CompoundTag> blockEntities, CompoundTag structureData, @Nullable CompoundTag attachmentData, @Nullable ListTag auxLightData)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CompoundTagThe field for theattachmentDatarecord component.private final ListTagThe field for theauxLightDatarecord component.private final BelowZeroRetrogenThe field for thebelowZeroRetrogenrecord component.The field for thebiomeRegistryrecord component.private final BlendingData.PackedThe field for theblendingDatarecord component.static final Stringprivate static final com.mojang.serialization.Codec<PalettedContainer<BlockState>> private static final Stringprivate final List<CompoundTag> The field for theblockEntitiesrecord component.private final long[]The field for thecarvingMaskrecord component.private final ChunkPosThe field for thechunkPosrecord component.private final ChunkStatusThe field for thechunkStatusrecord component.private final List<CompoundTag> The field for theentitiesrecord component.private static final Stringprivate final Map<Heightmap.Types, long[]> The field for theheightmapsrecord component.static final Stringprivate final longThe field for theinhabitedTimerecord component.static final Stringprivate final longThe field for thelastUpdateTimerecord component.private final booleanThe field for thelightCorrectrecord component.private static final org.slf4j.Loggerprivate final intThe field for theminSectionYrecord component.private final ChunkAccess.PackedTicksThe field for thepackedTicksrecord component.private final it.unimi.dsi.fastutil.shorts.ShortList[]The field for thepostProcessingSectionsrecord component.private final List<SerializableChunkData.SectionData> The field for thesectionDatarecord component.static final Stringstatic final Stringprivate final CompoundTagThe field for thestructureDatarecord component.private static final Stringprivate final UpgradeDataThe field for theupgradeDatarecord component.static final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionSerializableChunkData(Registry<Biome> biomeRegistry, ChunkPos chunkPos, int minSectionY, long lastUpdateTime, long inhabitedTime, ChunkStatus chunkStatus, BlendingData.Packed blendingData, BelowZeroRetrogen belowZeroRetrogen, UpgradeData upgradeData, long[] carvingMask, Map<Heightmap.Types, long[]> heightmaps, ChunkAccess.PackedTicks packedTicks, it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections, boolean lightCorrect, List<SerializableChunkData.SectionData> sectionData, List<CompoundTag> entities, List<CompoundTag> blockEntities, CompoundTag structureData) Deprecated.Neo: use constructor with additional data insteadSerializableChunkData(Registry<Biome> biomeRegistry, ChunkPos chunkPos, int minSectionY, long lastUpdateTime, long inhabitedTime, ChunkStatus chunkStatus, BlendingData.Packed blendingData, BelowZeroRetrogen belowZeroRetrogen, UpgradeData upgradeData, long[] carvingMask, Map<Heightmap.Types, long[]> heightmaps, ChunkAccess.PackedTicks packedTicks, it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections, boolean lightCorrect, List<SerializableChunkData.SectionData> sectionData, List<CompoundTag> entities, List<CompoundTag> blockEntities, CompoundTag structureData, CompoundTag attachmentData, ListTag auxLightData) Creates an instance of aSerializableChunkDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattachmentDatarecord component.Returns the value of theauxLightDatarecord component.Returns the value of thebelowZeroRetrogenrecord component.Returns the value of thebiomeRegistryrecord component.Returns the value of theblendingDatarecord component.Returns the value of theblockEntitiesrecord component.long[]Returns the value of thecarvingMaskrecord component.chunkPos()Returns the value of thechunkPosrecord component.Returns the value of thechunkStatusrecord component.static SerializableChunkDatacopyOf(ServerLevel pLevel, ChunkAccess pChunk) entities()Returns the value of theentitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.static ChunkStatusfinal inthashCode()Returns a hash code value for this object.Map<Heightmap.Types, long[]> Returns the value of theheightmapsrecord component.longReturns the value of theinhabitedTimerecord component.longReturns the value of thelastUpdateTimerecord component.booleanReturns the value of thelightCorrectrecord component.private static voidprivate static com.mojang.serialization.Codec<PalettedContainerRO<Holder<Biome>>> makeBiomeCodec(Registry<Biome> pBiomeRegistry) intReturns the value of theminSectionYrecord component.Returns the value of thepackedTicksrecord component.private static ListTagpackOffsets(it.unimi.dsi.fastutil.shorts.ShortList[] pOffsets) private static CompoundTagpackStructureData(StructurePieceSerializationContext pContext, ChunkPos pPos, Map<Structure, StructureStart> pStructureStarts, Map<Structure, it.unimi.dsi.fastutil.longs.LongSet> pReferences) static SerializableChunkDataparse(LevelHeightAccessor pLevelHeightAccessor, RegistryAccess pRegistries, CompoundTag pTag) private static LevelChunk.PostLoadProcessorpostLoadChunk(ServerLevel pLevel, List<CompoundTag> pEntities, List<CompoundTag> pBlockEntities) it.unimi.dsi.fastutil.shorts.ShortList[]Returns the value of thepostProcessingSectionsrecord component.read(ServerLevel pLevel, PoiManager pPoiManager, RegionStorageInfo pRegionStorageInfo, ChunkPos pPos) private static voidsaveTicks(CompoundTag pTag, ChunkAccess.PackedTicks pTicks) Returns the value of thesectionDatarecord component.Returns the value of thestructureDatarecord component.final StringtoString()Returns a string representation of this record class.unpackStructureReferences(RegistryAccess pRegistries, ChunkPos pPos, CompoundTag pTag) private static Map<Structure, StructureStart> unpackStructureStart(StructurePieceSerializationContext pContext, CompoundTag pTag, long pSeed) Returns the value of theupgradeDatarecord component.write()
-
Field Details
-
biomeRegistry
The field for thebiomeRegistryrecord component. -
chunkPos
The field for thechunkPosrecord component. -
minSectionY
private final int minSectionYThe field for theminSectionYrecord component. -
lastUpdateTime
private final long lastUpdateTimeThe field for thelastUpdateTimerecord component. -
inhabitedTime
private final long inhabitedTimeThe field for theinhabitedTimerecord component. -
chunkStatus
The field for thechunkStatusrecord component. -
blendingData
The field for theblendingDatarecord component. -
belowZeroRetrogen
The field for thebelowZeroRetrogenrecord component. -
upgradeData
The field for theupgradeDatarecord component. -
carvingMask
@Nullable private final long[] carvingMaskThe field for thecarvingMaskrecord component. -
heightmaps
The field for theheightmapsrecord component. -
packedTicks
The field for thepackedTicksrecord component. -
postProcessingSections
private final it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSectionsThe field for thepostProcessingSectionsrecord component. -
lightCorrect
private final boolean lightCorrectThe field for thelightCorrectrecord component. -
sectionData
The field for thesectionDatarecord component. -
entities
The field for theentitiesrecord component. -
blockEntities
The field for theblockEntitiesrecord component. -
structureData
The field for thestructureDatarecord component. -
attachmentData
The field for theattachmentDatarecord component. -
auxLightData
The field for theauxLightDatarecord component. -
BLOCK_STATE_CODEC
private static final com.mojang.serialization.Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC -
BLOCK_TICKS_CODEC
-
FLUID_TICKS_CODEC
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TAG_UPGRADE_DATA
- See Also:
-
BLOCK_TICKS_TAG
- See Also:
-
FLUID_TICKS_TAG
- See Also:
-
X_POS_TAG
- See Also:
-
Z_POS_TAG
- See Also:
-
HEIGHTMAPS_TAG
- See Also:
-
IS_LIGHT_ON_TAG
- See Also:
-
SECTIONS_TAG
- See Also:
-
BLOCK_LIGHT_TAG
- See Also:
-
SKY_LIGHT_TAG
- See Also:
-
-
Constructor Details
-
SerializableChunkData
@Deprecated SerializableChunkData(Registry<Biome> biomeRegistry, ChunkPos chunkPos, int minSectionY, long lastUpdateTime, long inhabitedTime, ChunkStatus chunkStatus, @Nullable BlendingData.Packed blendingData, @Nullable BelowZeroRetrogen belowZeroRetrogen, UpgradeData upgradeData, @Nullable long[] carvingMask, Map<Heightmap.Types, long[]> heightmaps, ChunkAccess.PackedTicks packedTicks, it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections, boolean lightCorrect, List<SerializableChunkData.SectionData> sectionData, List<CompoundTag> entities, List<CompoundTag> blockEntities, CompoundTag structureData) Deprecated.Neo: use constructor with additional data instead -
SerializableChunkData
public SerializableChunkData(Registry<Biome> biomeRegistry, ChunkPos chunkPos, int minSectionY, long lastUpdateTime, long inhabitedTime, ChunkStatus chunkStatus, @Nullable BlendingData.Packed blendingData, @Nullable BelowZeroRetrogen belowZeroRetrogen, UpgradeData upgradeData, @Nullable long[] carvingMask, Map<Heightmap.Types, long[]> heightmaps, ChunkAccess.PackedTicks packedTicks, it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections, boolean lightCorrect, List<SerializableChunkData.SectionData> sectionData, List<CompoundTag> entities, List<CompoundTag> blockEntities, CompoundTag structureData, @Nullable CompoundTag attachmentData, @Nullable ListTag auxLightData) Creates an instance of aSerializableChunkDatarecord class.- Parameters:
biomeRegistry- the value for thebiomeRegistryrecord componentchunkPos- the value for thechunkPosrecord componentminSectionY- the value for theminSectionYrecord componentlastUpdateTime- the value for thelastUpdateTimerecord componentinhabitedTime- the value for theinhabitedTimerecord componentchunkStatus- the value for thechunkStatusrecord componentblendingData- the value for theblendingDatarecord componentbelowZeroRetrogen- the value for thebelowZeroRetrogenrecord componentupgradeData- the value for theupgradeDatarecord componentcarvingMask- the value for thecarvingMaskrecord componentheightmaps- the value for theheightmapsrecord componentpackedTicks- the value for thepackedTicksrecord componentpostProcessingSections- the value for thepostProcessingSectionsrecord componentlightCorrect- the value for thelightCorrectrecord componentsectionData- the value for thesectionDatarecord componententities- the value for theentitiesrecord componentblockEntities- the value for theblockEntitiesrecord componentstructureData- the value for thestructureDatarecord componentattachmentData- the value for theattachmentDatarecord componentauxLightData- the value for theauxLightDatarecord component
-
-
Method Details
-
parse
@Nullable public static SerializableChunkData parse(LevelHeightAccessor pLevelHeightAccessor, RegistryAccess pRegistries, CompoundTag pTag) -
read
public ProtoChunk read(ServerLevel pLevel, PoiManager pPoiManager, RegionStorageInfo pRegionStorageInfo, ChunkPos pPos) -
logErrors
-
makeBiomeCodec
private static com.mojang.serialization.Codec<PalettedContainerRO<Holder<Biome>>> makeBiomeCodec(Registry<Biome> pBiomeRegistry) -
copyOf
-
write
-
saveTicks
-
getChunkStatusFromTag
-
postLoadChunk
@Nullable private static LevelChunk.PostLoadProcessor postLoadChunk(ServerLevel pLevel, List<CompoundTag> pEntities, List<CompoundTag> pBlockEntities) -
packStructureData
private static CompoundTag packStructureData(StructurePieceSerializationContext pContext, ChunkPos pPos, Map<Structure, StructureStart> pStructureStarts, Map<Structure, it.unimi.dsi.fastutil.longs.LongSet> pReferences) -
unpackStructureStart
private static Map<Structure,StructureStart> unpackStructureStart(StructurePieceSerializationContext pContext, CompoundTag pTag, long pSeed) -
unpackStructureReferences
private static Map<Structure,it.unimi.dsi.fastutil.longs.LongSet> unpackStructureReferences(RegistryAccess pRegistries, ChunkPos pPos, CompoundTag pTag) -
packOffsets
-
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 '=='. -
biomeRegistry
Returns the value of thebiomeRegistryrecord component.- Returns:
- the value of the
biomeRegistryrecord component
-
chunkPos
Returns the value of thechunkPosrecord component.- Returns:
- the value of the
chunkPosrecord component
-
minSectionY
public int minSectionY()Returns the value of theminSectionYrecord component.- Returns:
- the value of the
minSectionYrecord component
-
lastUpdateTime
public long lastUpdateTime()Returns the value of thelastUpdateTimerecord component.- Returns:
- the value of the
lastUpdateTimerecord component
-
inhabitedTime
public long inhabitedTime()Returns the value of theinhabitedTimerecord component.- Returns:
- the value of the
inhabitedTimerecord component
-
chunkStatus
Returns the value of thechunkStatusrecord component.- Returns:
- the value of the
chunkStatusrecord component
-
blendingData
Returns the value of theblendingDatarecord component.- Returns:
- the value of the
blendingDatarecord component
-
belowZeroRetrogen
Returns the value of thebelowZeroRetrogenrecord component.- Returns:
- the value of the
belowZeroRetrogenrecord component
-
upgradeData
Returns the value of theupgradeDatarecord component.- Returns:
- the value of the
upgradeDatarecord component
-
carvingMask
@Nullable public long[] carvingMask()Returns the value of thecarvingMaskrecord component.- Returns:
- the value of the
carvingMaskrecord component
-
heightmaps
Returns the value of theheightmapsrecord component.- Returns:
- the value of the
heightmapsrecord component
-
packedTicks
Returns the value of thepackedTicksrecord component.- Returns:
- the value of the
packedTicksrecord component
-
postProcessingSections
public it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections()Returns the value of thepostProcessingSectionsrecord component.- Returns:
- the value of the
postProcessingSectionsrecord component
-
lightCorrect
public boolean lightCorrect()Returns the value of thelightCorrectrecord component.- Returns:
- the value of the
lightCorrectrecord component
-
sectionData
Returns the value of thesectionDatarecord component.- Returns:
- the value of the
sectionDatarecord component
-
entities
Returns the value of theentitiesrecord component.- Returns:
- the value of the
entitiesrecord component
-
blockEntities
Returns the value of theblockEntitiesrecord component.- Returns:
- the value of the
blockEntitiesrecord component
-
structureData
Returns the value of thestructureDatarecord component.- Returns:
- the value of the
structureDatarecord component
-
attachmentData
Returns the value of theattachmentDatarecord component.- Returns:
- the value of the
attachmentDatarecord component
-
auxLightData
Returns the value of theauxLightDatarecord component.- Returns:
- the value of the
auxLightDatarecord component
-