Contents
Class BlockModule.BlockStateInfo
java.lang.Object
com.hypixel.hytale.server.core.modules.block.BlockModule.BlockStateInfo
- All Implemented Interfaces:
Component<ChunkStore>, Cloneable
- Enclosing class:
BlockModule
A component that represents the block state information for a block entity.
-
Field Summary
Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanfillWorldPos(ComponentAccessor<ChunkStore> accessor, org.joml.Vector3i outPos) booleanfillWorldPos(org.joml.Vector3i outPos) FillsoutPoswith the block's world position, resolved from the section's coordinates and the in-section index.intgetIndex()voidCalled to mark the associatedBlockComponentSectionas needing saving.voidmarkNeedsSaving(ComponentAccessor<ChunkStore> accessor) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Constructor Details
-
BlockStateInfo
- Parameters:
index- The index of the block within the section.sectionRef- The reference to the section containing the block.
-
-
Method Details
-
getComponentType
- Returns:
- the component type for the
BlockModule.BlockStateInfocomponent.
-
getIndex
public int getIndex() -
getSectionRef
-
markNeedsSaving
public void markNeedsSaving()Called to mark the associatedBlockComponentSectionas needing saving. -
markNeedsSaving
-
fillWorldPos
public boolean fillWorldPos(@Nonnull org.joml.Vector3i outPos) FillsoutPoswith the block's world position, resolved from the section's coordinates and the in-section index. Independent of block data, so it works even when the block has already been cleared (e.g. during removal).- Returns:
trueifoutPoswas filled;falsewhen the section reference is no longer valid or itsChunkSectionis missing.
-
fillWorldPos
public boolean fillWorldPos(@Nonnull ComponentAccessor<ChunkStore> accessor, @Nonnull org.joml.Vector3i outPos) -
clone
- Specified by:
clonein interfaceComponent<ChunkStore>- Returns:
- a clone instance of the original component instance.
-