Class BlockModule.BlockStateInfo

java.lang.Object
com.hypixel.hytale.server.core.modules.block.BlockModule.BlockStateInfo
All Implemented Interfaces:
Component<ChunkStore>, Cloneable
Enclosing class:
BlockModule

public static class BlockModule.BlockStateInfo extends Object implements Component<ChunkStore>
A component that represents the block state information for a block entity.
  • Constructor Details

    • BlockStateInfo

      public BlockStateInfo(int index, @Nonnull Ref<ChunkStore> sectionRef)
      Parameters:
      index - The index of the block within the section.
      sectionRef - The reference to the section containing the block.
  • Method Details

    • getComponentType

      public static ComponentType<ChunkStore, BlockModule.BlockStateInfo> getComponentType()
      Returns:
      the component type for the BlockModule.BlockStateInfo component.
    • getIndex

      public int getIndex()
    • getSectionRef

      @Nonnull public Ref<ChunkStore> getSectionRef()
    • markNeedsSaving

      public void markNeedsSaving()
      Called to mark the associated BlockComponentSection as needing saving.
    • markNeedsSaving

      public void markNeedsSaving(ComponentAccessor<ChunkStore> accessor)
    • fillWorldPos

      public boolean fillWorldPos(@Nonnull org.joml.Vector3i outPos)
      Fills outPos with 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:
      true if outPos was filled; false when the section reference is no longer valid or its ChunkSection is missing.
    • fillWorldPos

      public boolean fillWorldPos(@Nonnull ComponentAccessor<ChunkStore> accessor, @Nonnull org.joml.Vector3i outPos)
    • clone

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