BlockChunk

public class BlockChunk implements Component

Class BlockChunk. Provides blockchunk functionality for the Hytale server.

java.lang.Object > BlockChunk

Field Summary

index

private long index

Field index.

x

private int x

Field x.

z

private int z

Field z.

chunkSections

private BlockSection[] chunkSections

Field chunkSections.

migratedChunkSections

private BlockSection[] migratedChunkSections

Field migratedChunkSections.

environments

private EnvironmentChunk environments

Field environments.

needsPhysics

private boolean needsPhysics

Field needsPhysics.

needsSaving

private boolean needsSaving

Field needsSaving.

section

final BlockSection section

Field section.

blockId

final int blockId

Field blockId.

type

final BlockType type

Field type.

column

final ChunkColumn column

Field column.

sections

final Holder[] sections

Field sections.

sectionIndex

final int sectionIndex

Field sectionIndex.

changed

final boolean changed

Field changed.

map

final Int2IntMap map

Field map.

count

final short count

Field count.

set

final IntSet set

Field set.

wx

final int wx

Field wx.

wz

final int wz

Field wz.

wy

final int wy

Field wy.

out

final boolean out

Field out.

old

final boolean old

Field old.

temp

final BlockSection[] temp

Field temp.

buf

final ByteBuf buf

Field buf.

ref

final SoftReference>> ref

Field ref.

packet

final SetChunkHeightmap packet

Field packet.

component

final BlockChunk component

Field component.

Method Detail

getComponentType

public BlockChunk> getComponentType ()

Method getComponentType.

BlockChunk

public private BlockChunk ()

Method BlockChunk.

ShortBytePalette

public new ShortBytePalette ()

Method ShortBytePalette.

IntBytePalette

public new IntBytePalette ()

Method IntBytePalette.

EnvironmentChunk

public new EnvironmentChunk ()

Method EnvironmentChunk.

load

public void load (final int x, final int z)

Method load.

Parameters:
final int x
final int z

clone

public Component clone ()

Method clone.

cloneSerializable

public Component cloneSerializable ()

Method cloneSerializable.

getIndex

public long getIndex ()

Method getIndex.

getX

public int getX ()

Method getX.

getZ

public int getZ ()

Method getZ.

getEnvironmentChunk

public EnvironmentChunk getEnvironmentChunk ()

Method getEnvironmentChunk.

setEnvironmentChunk

public void setEnvironmentChunk (final EnvironmentChunk environmentChunk)

Method setEnvironmentChunk.

Parameters:
final EnvironmentChunk environmentChunk

getHeight

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

Method getHeight.

Parameters:
final int x
final int z

setHeight

public void setHeight (final int x, final int z, final short height)

Method setHeight.

Parameters:
final int x
final int z
final short height

updateHeightmap

public void updateHeightmap ()

Method updateHeightmap.

updateHeight

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

Method updateHeight.

Parameters:
final int x
final int z

loadFromHolder

public void loadFromHolder (@Nonnull final Holder holder)

Method loadFromHolder.

Parameters:
@Nonnull final Holder holder

getSectionAtIndex

public BlockSection getSectionAtIndex (final int index)

Method getSectionAtIndex.

Parameters:
final int index

getSectionAtBlockY

public BlockSection getSectionAtBlockY (final int y)

Method getSectionAtBlockY.

Parameters:
final int y

getChunkSections

public BlockSection[] getChunkSections ()

Method getChunkSections.

getSectionCount

public int getSectionCount ()

Method getSectionCount.

getTint

public int getTint (final int x, final int z)

Method getTint.

Parameters:
final int x
final int z

setTint

public void setTint (final int x, final int z, final int tint)

Method setTint.

Parameters:
final int x
final int z
final int tint

getEnvironment

public int getEnvironment (@Nonnull final Vector3d position)

Method getEnvironment.

Parameters:
@Nonnull final Vector3d position

getEnvironmentColumn

public EnvironmentColumn getEnvironmentColumn (final int x, final int z)

Method getEnvironmentColumn.

Parameters:
final int x
final int z

setEnvironment

public void setEnvironment (final int x, final int y, final int z, final int environment)

Method setEnvironment.

Parameters:
final int x
final int y
final int z
final int environment

getRedBlockLight

public byte getRedBlockLight (final int x, final int y, final int z)

Method getRedBlockLight.

Parameters:
final int x
final int y
final int z

getGreenBlockLight

public byte getGreenBlockLight (final int x, final int y, final int z)

Method getGreenBlockLight.

Parameters:
final int x
final int y
final int z

getBlueBlockLight

public byte getBlueBlockLight (final int x, final int y, final int z)

Method getBlueBlockLight.

Parameters:
final int x
final int y
final int z

getBlockLight

public short getBlockLight (final int x, final int y, final int z)

Method getBlockLight.

Parameters:
final int x
final int y
final int z

getSkyLight

public byte getSkyLight (final int x, final int y, final int z)

Method getSkyLight.

Parameters:
final int x
final int y
final int z

getBlockLightIntensity

public byte getBlockLightIntensity (final int x, final int y, final int z)

Method getBlockLightIntensity.

Parameters:
final int x
final int y
final int z

getBlock

public int getBlock (final int x, final int y, final int z)

Method getBlock.

Parameters:
final int x
final int y
final int z

setBlock

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

Method setBlock.

Parameters:
final int x
final int y
final int z
final int blockId
final int rotation
final int filler

contains

public boolean contains (final int blockId)

Method contains.

Parameters:
final int blockId

count

public int count (final int blockId)

Method count.

Parameters:
final int blockId

blockCounts

public Int2IntMap blockCounts ()

Method blockCounts.

blocks

public IntSet blocks ()

Method blocks.

blockCount

public int blockCount ()

Method blockCount.

preTick

public void preTick (final Instant gameTime)

Method preTick.

Parameters:
final Instant gameTime

forEachTicking

public int forEachTicking (final T t, final V v, final ObjectPositionBlockFunction acceptor)

Method forEachTicking.

Parameters:
final T t
final V v
final ObjectPositionBlockFunction acceptor

mergeTickingBlocks

public void mergeTickingBlocks ()

Method mergeTickingBlocks.

setTicking

public boolean setTicking (final int x, final int y, final int z, final boolean ticking)

Method setTicking.

Parameters:
final int x
final int y
final int z
final boolean ticking

isTicking

public boolean isTicking (final int x, final int y, final int z)

Method isTicking.

Parameters:
final int x
final int y
final int z

getTickingBlocksCount

public int getTickingBlocksCount ()

Method getTickingBlocksCount.

setNeighbourBlocksTicking

public boolean setNeighbourBlocksTicking (final int x, final int y, final int z)

Method setNeighbourBlocksTicking.

Parameters:
final int x
final int y
final int z

markNeedsSaving

public void markNeedsSaving ()

Method markNeedsSaving.

getNeedsSaving

public boolean getNeedsSaving ()

Method getNeedsSaving.

consumeNeedsSaving

public boolean consumeNeedsSaving ()

Method consumeNeedsSaving.

markNeedsPhysics

public void markNeedsPhysics ()

Method markNeedsPhysics.

consumeNeedsPhysics

public boolean consumeNeedsPhysics ()

Method consumeNeedsPhysics.

invalidateChunkSection

public void invalidateChunkSection (final int sectionIndex)

Method invalidateChunkSection.

Parameters:
final int sectionIndex

takeMigratedSections

public BlockSection[] takeMigratedSections ()

Method takeMigratedSections.

getMigratedSections

public BlockSection[] getMigratedSections ()

Method getMigratedSections.

serialize

private byte[] serialize (final ExtraInfo extraInfo)

Method serialize.

Parameters:
final ExtraInfo extraInfo

deserialize

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

Method deserialize.

Parameters:
@Nonnull final byte[] bytes
@Nonnull final ExtraInfo extraInfo

getCachedHeightmapPacket

private CompletableFuture> getCachedHeightmapPacket ()

Method getCachedHeightmapPacket.

SetChunkHeightmap

public new SetChunkHeightmap (this.x, this.z, this.height.serialize()

Method SetChunkHeightmap.

Parameters:
this.x this.x
this.z this.z
this.height.serialize( this.height.serialize(

getCachedTintsPacket

private CompletableFuture> getCachedTintsPacket ()

Method getCachedTintsPacket.

SetChunkTintmap

public new SetChunkTintmap (this.x, this.z, this.tint.serialize()

Method SetChunkTintmap.

Parameters:
this.x this.x
this.z this.z
this.tint.serialize( this.tint.serialize(

getCachedEnvironmentsPacket

private CompletableFuture> getCachedEnvironmentsPacket ()

Method getCachedEnvironmentsPacket.

SetChunkEnvironments

public new SetChunkEnvironments (this.x, this.z, this.environments.serializeProtocol()

Method SetChunkEnvironments.

Parameters:
this.x this.x
this.z this.z
this.environments.serializeProtocol( this.environments.serializeProtocol(

LoadBlockChunkPacketSystem

public public LoadBlockChunkPacketSystem (final ComponentType blockChunkComponentType)

Method LoadBlockChunkPacketSystem.

Parameters:
final ComponentType blockChunkComponentType

getQuery

public Query getQuery ()

Method getQuery.

fetch

public void fetch (final int index, @Nonnull final ArchetypeChunk archetypeChunk, final Store store, final CommandBuffer commandBuffer, final PlayerRef player, @Nonnull final List> results)

Method fetch.

Parameters:
final int index
@Nonnull final ArchetypeChunk archetypeChunk
final Store store
final CommandBuffer commandBuffer
final PlayerRef player
@Nonnull final List> results

chunk

public set chunk (%d, %d)

Method chunk.

Parameters:
%d %d