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

    • VERSION

      public static final int VERSION
      See Also:
    • CODEC

      public static final BuilderCodec<BlockChunk> CODEC
    • LOGGER

      private static final com.hypixel.hytale.logger.HytaleLogger LOGGER
    • SEND_LOCAL_LIGHTING_DATA

      public static boolean SEND_LOCAL_LIGHTING_DATA
    • SEND_GLOBAL_LIGHTING_DATA

      public static boolean SEND_GLOBAL_LIGHTING_DATA
    • index

      private long index
    • x

      private int x
    • z

      private int z
    • height

      private final ShortBytePalette height
    • tint

      private final IntBytePalette tint
    • chunkSections

      @Deprecated(forRemoval=true) private com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection[] chunkSections
      Deprecated, for removal: This API element is subject to removal in a future version.
    • migratedChunkSections

      @Nullable @Deprecated(forRemoval=true) private com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection[] migratedChunkSections
      Deprecated, for removal: This API element is subject to removal in a future version.
    • environments

      private EnvironmentChunk environments
    • needsPhysics

      private boolean needsPhysics
    • needsSaving

      private boolean needsSaving
    • cachedHeightmapPacket

      @Nullable private transient SoftReference<CompletableFuture<CachedPacket<SetChunkHeightmap>>> cachedHeightmapPacket
    • cachedTintmapPacket

      @Nullable private transient SoftReference<CompletableFuture<CachedPacket<SetChunkTintmap>>> cachedTintmapPacket
    • cachedEnvironmentsPacket

      @Nullable private transient SoftReference<CompletableFuture<CachedPacket<SetChunkEnvironments>>> cachedEnvironmentsPacket
  • Constructor Details

  • 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>
      Overrides:
      clone in class Object
    • cloneSerializable

      @Nonnull public Component<ChunkStore> cloneSerializable()
      Specified by:
      cloneSerializable in interface Component<ChunkStore>
    • getIndex

      public long getIndex()
    • getX

      public int getX()
    • getZ

      public int getZ()
    • getEnvironmentChunk

      public EnvironmentChunk getEnvironmentChunk()
    • setEnvironmentChunk

      public void setEnvironmentChunk(EnvironmentChunk environmentChunk)
    • getHeight

      public short getHeight(int x, int z)
    • getHeight

      public short getHeight(int index)
    • setHeight

      public void setHeight(int x, int z, short height)
    • updateHeightmap

      public void updateHeightmap()
    • updateHeight

      public short updateHeight(int x, int z)
    • updateHeight

      public short updateHeight(int x, int z, short startY)
    • 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.
    • getSectionAtIndex

      @Deprecated(forRemoval=false) public com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection getSectionAtIndex(int index)
      Deprecated.
    • getSectionAtBlockY

      @Deprecated(forRemoval=false) public com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection getSectionAtBlockY(int y)
      Deprecated.
    • getChunkSections

      @Deprecated(forRemoval=false) public com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection[] getChunkSections()
      Deprecated.
    • getSectionCount

      public int getSectionCount()
    • getTint

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

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

      public int getEnvironment(@Nonnull Vector3d position)
    • getEnvironment

      public int getEnvironment(@Nonnull Vector3i position)
    • getEnvironment

      public int getEnvironment(int x, int y, int z)
    • getEnvironmentColumn

      public EnvironmentColumn getEnvironmentColumn(int x, int z)
    • setEnvironment

      public void setEnvironment(int x, int y, int z, int environment)
    • getRedBlockLight

      public byte getRedBlockLight(int x, int y, int z)
    • getGreenBlockLight

      public byte getGreenBlockLight(int x, int y, int z)
    • getBlueBlockLight

      public byte getBlueBlockLight(int x, int y, int z)
    • getBlockLight

      public short getBlockLight(int x, int y, int z)
    • getSkyLight

      public byte getSkyLight(int x, int y, int z)
    • getBlockLightIntensity

      public byte getBlockLightIntensity(int x, int y, int z)
    • getBlock

      public int getBlock(int x, int y, int z)
    • setBlock

      public boolean setBlock(int x, int y, int z, int blockId, int rotation, int filler)
    • contains

      public boolean contains(int blockId)
    • count

      public int count(int blockId)
    • blockCounts

      @Nonnull public it.unimi.dsi.fastutil.ints.Int2IntMap blockCounts()
    • blocks

      @Nonnull public it.unimi.dsi.fastutil.ints.IntSet blocks()
    • blockCount

      public int blockCount()
    • preTick

      public void preTick(Instant gameTime)
    • forEachTicking

      public <T, V> int forEachTicking(T t, V v, ObjectPositionBlockFunction<T,V,BlockTickStrategy> acceptor)
    • mergeTickingBlocks

      public void mergeTickingBlocks()
    • setTicking

      public boolean setTicking(int x, int y, int z, boolean ticking)
    • isTicking

      public boolean isTicking(int x, int y, int z)
    • getTickingBlocksCount

      public int getTickingBlocksCount()
    • setNeighbourBlocksTicking

      public boolean setNeighbourBlocksTicking(int x, int y, int z)
    • markNeedsSaving

      public void markNeedsSaving()
    • getNeedsSaving

      public boolean getNeedsSaving()
    • consumeNeedsSaving

      public boolean consumeNeedsSaving()
    • markNeedsPhysics

      public void markNeedsPhysics()
    • consumeNeedsPhysics

      public boolean consumeNeedsPhysics()
    • invalidateChunkSection

      public void invalidateChunkSection(int sectionIndex)
    • takeMigratedSections

      @Nullable @Deprecated(forRemoval=true) public com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection[] takeMigratedSections()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getMigratedSections

      @Nullable @Deprecated(forRemoval=true) public com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection[] getMigratedSections()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • serialize

      private byte[] serialize(ExtraInfo extraInfo)
    • deserialize

      private void deserialize(@Nonnull byte[] bytes, @Nonnull ExtraInfo extraInfo)
    • getCachedHeightmapPacket

      @Nonnull private CompletableFuture<CachedPacket<SetChunkHeightmap>> getCachedHeightmapPacket()
    • getCachedTintsPacket

      @Nonnull private CompletableFuture<CachedPacket<SetChunkTintmap>> getCachedTintsPacket()
    • getCachedEnvironmentsPacket

      @Nonnull private CompletableFuture<CachedPacket<SetChunkEnvironments>> getCachedEnvironmentsPacket()