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
  • Field Details

    • biomeRegistry

      private final Registry<Biome> biomeRegistry
      The field for the biomeRegistry record component.
    • chunkPos

      private final ChunkPos chunkPos
      The field for the chunkPos record component.
    • minSectionY

      private final int minSectionY
      The field for the minSectionY record component.
    • lastUpdateTime

      private final long lastUpdateTime
      The field for the lastUpdateTime record component.
    • inhabitedTime

      private final long inhabitedTime
      The field for the inhabitedTime record component.
    • chunkStatus

      private final ChunkStatus chunkStatus
      The field for the chunkStatus record component.
    • blendingData

      @Nullable private final BlendingData.Packed blendingData
      The field for the blendingData record component.
    • belowZeroRetrogen

      @Nullable private final BelowZeroRetrogen belowZeroRetrogen
      The field for the belowZeroRetrogen record component.
    • upgradeData

      private final UpgradeData upgradeData
      The field for the upgradeData record component.
    • carvingMask

      @Nullable private final long[] carvingMask
      The field for the carvingMask record component.
    • heightmaps

      private final Map<Heightmap.Types,long[]> heightmaps
      The field for the heightmaps record component.
    • packedTicks

      private final ChunkAccess.PackedTicks packedTicks
      The field for the packedTicks record component.
    • postProcessingSections

      private final it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections
      The field for the postProcessingSections record component.
    • lightCorrect

      private final boolean lightCorrect
      The field for the lightCorrect record component.
    • sectionData

      private final List<SerializableChunkData.SectionData> sectionData
      The field for the sectionData record component.
    • entities

      private final List<CompoundTag> entities
      The field for the entities record component.
    • blockEntities

      private final List<CompoundTag> blockEntities
      The field for the blockEntities record component.
    • structureData

      private final CompoundTag structureData
      The field for the structureData record component.
    • attachmentData

      @Nullable private final CompoundTag attachmentData
      The field for the attachmentData record component.
    • auxLightData

      @Nullable private final ListTag auxLightData
      The field for the auxLightData record component.
    • BLOCK_STATE_CODEC

      private static final com.mojang.serialization.Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC
    • BLOCK_TICKS_CODEC

      private static final com.mojang.serialization.Codec<List<SavedTick<Block>>> BLOCK_TICKS_CODEC
    • FLUID_TICKS_CODEC

      private static final com.mojang.serialization.Codec<List<SavedTick<Fluid>>> FLUID_TICKS_CODEC
    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • TAG_UPGRADE_DATA

      private static final String TAG_UPGRADE_DATA
      See Also:
    • BLOCK_TICKS_TAG

      private static final String BLOCK_TICKS_TAG
      See Also:
    • FLUID_TICKS_TAG

      private static final String FLUID_TICKS_TAG
      See Also:
    • X_POS_TAG

      public static final String X_POS_TAG
      See Also:
    • Z_POS_TAG

      public static final String Z_POS_TAG
      See Also:
    • HEIGHTMAPS_TAG

      public static final String HEIGHTMAPS_TAG
      See Also:
    • IS_LIGHT_ON_TAG

      public static final String IS_LIGHT_ON_TAG
      See Also:
    • SECTIONS_TAG

      public static final String SECTIONS_TAG
      See Also:
    • BLOCK_LIGHT_TAG

      public static final String BLOCK_LIGHT_TAG
      See Also:
    • SKY_LIGHT_TAG

      public static final String 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 a SerializableChunkData record class.
      Parameters:
      biomeRegistry - the value for the biomeRegistry record component
      chunkPos - the value for the chunkPos record component
      minSectionY - the value for the minSectionY record component
      lastUpdateTime - the value for the lastUpdateTime record component
      inhabitedTime - the value for the inhabitedTime record component
      chunkStatus - the value for the chunkStatus record component
      blendingData - the value for the blendingData record component
      belowZeroRetrogen - the value for the belowZeroRetrogen record component
      upgradeData - the value for the upgradeData record component
      carvingMask - the value for the carvingMask record component
      heightmaps - the value for the heightmaps record component
      packedTicks - the value for the packedTicks record component
      postProcessingSections - the value for the postProcessingSections record component
      lightCorrect - the value for the lightCorrect record component
      sectionData - the value for the sectionData record component
      entities - the value for the entities record component
      blockEntities - the value for the blockEntities record component
      structureData - the value for the structureData record component
      attachmentData - the value for the attachmentData record component
      auxLightData - the value for the auxLightData record component
  • Method Details

    • parse

      @Nullable public static SerializableChunkData parse(LevelHeightAccessor p_361938_, RegistryAccess p_365010_, CompoundTag p_362040_)
    • read

      public ProtoChunk read(ServerLevel p_360452_, PoiManager p_364451_, RegionStorageInfo p_364971_, ChunkPos p_360628_)
    • logErrors

      private static void logErrors(ChunkPos p_361949_, int p_364275_, String p_360703_)
    • makeBiomeCodec

      private static com.mojang.serialization.Codec<PalettedContainerRO<Holder<Biome>>> makeBiomeCodec(Registry<Biome> p_364562_)
    • copyOf

      public static SerializableChunkData copyOf(ServerLevel p_365319_, ChunkAccess p_362284_)
    • write

      public CompoundTag write()
    • saveTicks

      private static void saveTicks(CompoundTag p_362920_, ChunkAccess.PackedTicks p_361228_)
    • getChunkStatusFromTag

      public static ChunkStatus getChunkStatusFromTag(@Nullable CompoundTag p_405768_)
    • postLoadChunk

      @Nullable private static LevelChunk.PostLoadProcessor postLoadChunk(ServerLevel p_363005_, List<CompoundTag> p_362405_, List<CompoundTag> p_364156_)
    • packStructureData

      private static CompoundTag packStructureData(StructurePieceSerializationContext p_361063_, ChunkPos p_365377_, Map<Structure,StructureStart> p_365385_, Map<Structure,it.unimi.dsi.fastutil.longs.LongSet> p_362410_)
    • unpackStructureStart

      private static Map<Structure,StructureStart> unpackStructureStart(StructurePieceSerializationContext p_360982_, CompoundTag p_363682_, long p_362695_)
    • unpackStructureReferences

      private static Map<Structure,it.unimi.dsi.fastutil.longs.LongSet> unpackStructureReferences(RegistryAccess p_360856_, ChunkPos p_362116_, CompoundTag p_360575_)
    • packOffsets

      private static ListTag packOffsets(it.unimi.dsi.fastutil.shorts.ShortList[] p_364852_)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • biomeRegistry

      public Registry<Biome> biomeRegistry()
      Returns the value of the biomeRegistry record component.
      Returns:
      the value of the biomeRegistry record component
    • chunkPos

      public ChunkPos chunkPos()
      Returns the value of the chunkPos record component.
      Returns:
      the value of the chunkPos record component
    • minSectionY

      public int minSectionY()
      Returns the value of the minSectionY record component.
      Returns:
      the value of the minSectionY record component
    • lastUpdateTime

      public long lastUpdateTime()
      Returns the value of the lastUpdateTime record component.
      Returns:
      the value of the lastUpdateTime record component
    • inhabitedTime

      public long inhabitedTime()
      Returns the value of the inhabitedTime record component.
      Returns:
      the value of the inhabitedTime record component
    • chunkStatus

      public ChunkStatus chunkStatus()
      Returns the value of the chunkStatus record component.
      Returns:
      the value of the chunkStatus record component
    • blendingData

      @Nullable public BlendingData.Packed blendingData()
      Returns the value of the blendingData record component.
      Returns:
      the value of the blendingData record component
    • belowZeroRetrogen

      @Nullable public BelowZeroRetrogen belowZeroRetrogen()
      Returns the value of the belowZeroRetrogen record component.
      Returns:
      the value of the belowZeroRetrogen record component
    • upgradeData

      public UpgradeData upgradeData()
      Returns the value of the upgradeData record component.
      Returns:
      the value of the upgradeData record component
    • carvingMask

      @Nullable public long[] carvingMask()
      Returns the value of the carvingMask record component.
      Returns:
      the value of the carvingMask record component
    • heightmaps

      public Map<Heightmap.Types,long[]> heightmaps()
      Returns the value of the heightmaps record component.
      Returns:
      the value of the heightmaps record component
    • packedTicks

      public ChunkAccess.PackedTicks packedTicks()
      Returns the value of the packedTicks record component.
      Returns:
      the value of the packedTicks record component
    • postProcessingSections

      public it.unimi.dsi.fastutil.shorts.ShortList[] postProcessingSections()
      Returns the value of the postProcessingSections record component.
      Returns:
      the value of the postProcessingSections record component
    • lightCorrect

      public boolean lightCorrect()
      Returns the value of the lightCorrect record component.
      Returns:
      the value of the lightCorrect record component
    • sectionData

      public List<SerializableChunkData.SectionData> sectionData()
      Returns the value of the sectionData record component.
      Returns:
      the value of the sectionData record component
    • entities

      public List<CompoundTag> entities()
      Returns the value of the entities record component.
      Returns:
      the value of the entities record component
    • blockEntities

      public List<CompoundTag> blockEntities()
      Returns the value of the blockEntities record component.
      Returns:
      the value of the blockEntities record component
    • structureData

      public CompoundTag structureData()
      Returns the value of the structureData record component.
      Returns:
      the value of the structureData record component
    • attachmentData

      @Nullable public CompoundTag attachmentData()
      Returns the value of the attachmentData record component.
      Returns:
      the value of the attachmentData record component
    • auxLightData

      @Nullable public ListTag auxLightData()
      Returns the value of the auxLightData record component.
      Returns:
      the value of the auxLightData record component