Class BlockChunk

java.lang.Object
com.hypixel.hytale.server.core.universe.world.chunk.BlockChunk
All Implemented Interfaces:
Component<ChunkStore>, Cloneable

public class BlockChunk extends Object implements Component<ChunkStore>
Since:
22.02.2016
  • Field Details

    • VERSION

      public static final int VERSION
      Version history: == Pre launch, removed == * Version 0: Initial version * Version 1: Fluids are no longer blocks. Extracted from PaletteChunkSection into FluidSection * Version 2: Deco blocks and support blocks removed and placed in BlockPhysics. * Version 3: Moved most data into a chunk section instead of column == Post launch == * Version 4: Moved heightmap to dedicated component
      See Also:
    • CODEC

      public static final BuilderCodec<BlockChunk> CODEC
    • SEND_LOCAL_LIGHTING_DATA

      public static boolean SEND_LOCAL_LIGHTING_DATA
    • SEND_GLOBAL_LIGHTING_DATA

      public static boolean SEND_GLOBAL_LIGHTING_DATA
  • Constructor Details

    • BlockChunk

      public BlockChunk(int x, int z)
    • BlockChunk

      public BlockChunk(int x, int z, IntBytePalette tint)
  • Method Details

    • getComponentType

      public static ComponentType<ChunkStore, BlockChunk> getComponentType()
    • load

      public void load(int x, int z)
    • clone

      public Component<ChunkStore> clone()
      Specified by:
      clone in interface Component<ChunkStore>
      Returns:
      a clone instance of the original component instance.

    • cloneSerializable

      @Nonnull public Component<ChunkStore> cloneSerializable()
      Specified by:
      cloneSerializable in interface Component<ChunkStore>
      Returns:
      a clone instance of the original component instance.

    • getIndex

      public long getIndex()
    • getX

      public int getX()
    • getZ

      public int getZ()
    • setHeightmapColumn

      public void setHeightmapColumn(HeightmapColumn heightmapColumn)
    • hasLegacyHeightmap

      public boolean hasLegacyHeightmap()
    • takeLegacyHeightmap

      @Nullable public ShortBytePalette takeLegacyHeightmap()
    • loadFromHolder

      @Deprecated(forRemoval=true) public void loadFromHolder(@Nonnull Holder<ChunkStore> holder)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • refreshSectionRefs

      @Deprecated(forRemoval=true) public void refreshSectionRefs(@Nonnull Holder<ChunkStore>[] sectionHolders)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Refresh the cached EnvironmentSection references from the given section holders.

      The initial cache is populated during pre-load via loadFromHolder(Holder). Cubic-chunk loads may leave slots empty during pre-load, and those slots are populated here from the now-installed components.

    • getTint

      public int getTint(int x, int z)
    • setTint

      public void setTint(int x, int z, int tint)
    • readEnvironmentRuns

      @Deprecated(forRemoval=true) public void readEnvironmentRuns(int x, int z, @Nonnull BlockChunk.EnvironmentRunCursor cursor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      environments belong to EnvironmentSection. Read the runs of a resolved section with EnvironmentSection.readColumnRuns(int, int, EnvironmentSection.ColumnRuns) instead. This walks only the legacy 0..ChunkUtil.HEIGHT band.
      Binds the given cursor to the environment runs of one block column, bottom to top, with world y coordinates (0..ChunkUtil.HEIGHT - 1). Runs that continue across section borders are merged into one run.

      Reuse one cursor across many columns to keep the walk allocation free.

    • markNeedsSaving

      public void markNeedsSaving()
    • getNeedsSaving

      public boolean getNeedsSaving()
    • consumeNeedsSaving

      public boolean consumeNeedsSaving()
    • invalidateColumnPacket

      public void invalidateColumnPacket()
      Drops the cached column packet so the next send rebuilds it from current state. Must be called when the column heightmap changes, because the cached SetColumn embeds serializeToInts(), so without this a (re)tracking client is served a stale heightmap (e.g. an out-of-view island's true top reverting to the ground prediction). Tint edits invalidate inline.
    • getCachedTintsPacket

      @Nonnull public CompletableFuture<CachedPacket<SetChunkTintmap>> getCachedTintsPacket()