BlockState

abstract class BlockState implements Component

Class BlockState. Provides blockstate functionality for the Hytale server.

java.lang.Object > BlockState

Field Summary

initialized

final AtomicBoolean initialized

Field initialized.

chunk

private WorldChunk chunk

Field chunk.

position

private Vector3i position

Field position.

reference

protected Ref reference

Field reference.

blockType

final BlockType blockType

Field blockType.

blockCenter

final Vector3d blockCenter

Field blockCenter.

document

final BsonDocument document

Field document.

holder

final Holder holder

Field holder.

componentStore

final Store componentStore

Field componentStore.

archetype

final Archetype archetype

Field archetype.

componentType

final ComponentType componentType

Field componentType.

state

final StateData state

Field state.

blockState

final BlockState blockState

Field blockState.

Method Detail

BlockState

public public BlockState ()

Method BlockState.

setReference

public void setReference (final Ref reference)

Method setReference.

Parameters:
final Ref reference

IllegalArgumentException

public new IllegalArgumentException ("Entity already has a valid EntityReference: " + String.valueOf(this.reference)

Method IllegalArgumentException.

Parameters:
"Entity already has a valid EntityReference: " + String.valueOf(this.reference

getReference

public Ref getReference ()

Method getReference.

unloadFromWorld

public void unloadFromWorld ()

Method unloadFromWorld.

initialize

public boolean initialize (final BlockType blockType)

Method initialize.

Parameters:
final BlockType blockType

onUnload

public void onUnload ()

Method onUnload.

validateInitialized

public void validateInitialized ()

Method validateInitialized.

getIndex

public int getIndex ()

Method getIndex.

setPosition

public void setPosition (final WorldChunk chunk, @Nullable final Vector3i position)

Method setPosition.

Parameters:
final WorldChunk chunk
@Nullable final Vector3i position

to

public set to (0, 0, 0)

Method to.

Parameters:
0 0

getPosition

public Vector3i getPosition ()

Method getPosition.

__internal_getPosition

public Vector3i __internal_getPosition ()

Method __internal_getPosition.

getBlockX

public int getBlockX ()

Method getBlockX.

getBlockY

public int getBlockY ()

Method getBlockY.

getBlockZ

public int getBlockZ ()

Method getBlockZ.

getBlockPosition

public Vector3i getBlockPosition ()

Method getBlockPosition.

Vector3i

public new Vector3i (this.getBlockX()

Method Vector3i.

Parameters:
this.getBlockX( this.getBlockX(

getCenteredBlockPosition

public Vector3d getCenteredBlockPosition ()

Method getCenteredBlockPosition.

getChunk

public WorldChunk getChunk ()

Method getChunk.

getBlockType

public BlockType getBlockType ()

Method getBlockType.

getRotationIndex

public int getRotationIndex ()

Method getRotationIndex.

invalidate

public void invalidate ()

Method invalidate.

markNeedsSave

public void markNeedsSave ()

Method markNeedsSave.

saveToDocument

public BsonDocument saveToDocument ()

Method saveToDocument.

clone

public Component clone ()

Method clone.

toHolder

public Holder toHolder ()

Method toHolder.

load

static BlockState load (final BsonDocument doc, @Nonnull final WorldChunk chunk, @Nonnull final Vector3i pos)

Method load.

Parameters:
final BsonDocument doc
@Nonnull final WorldChunk chunk
@Nonnull final Vector3i pos

ensureState

static BlockState ensureState (@Nonnull final WorldChunk worldChunk, final int x, final int y, final int z)

Method ensureState.

Parameters:
@Nonnull final WorldChunk worldChunk
final int x
final int y
final int z

getBlockState

static BlockState getBlockState (@Nullable final Ref reference, @Nonnull final ComponentAccessor componentAccessor)

Method getBlockState.

Parameters:
@Nullable final Ref reference
@Nonnull final ComponentAccessor componentAccessor

findComponentType

public T> findComponentType (@Nonnull final Archetype archetype, @Nonnull final Class entityClass)

Method findComponentType.

Parameters:
@Nonnull final Archetype archetype
@Nonnull final Class entityClass