Class BlockHealthModule

All Implemented Interfaces:
CommandOwner

public class BlockHealthModule extends JavaPlugin
Applies, regenerates and replicates block health per chunk section.
  • Field Details

  • Constructor Details

    • BlockHealthModule

      public BlockHealthModule(@Nonnull JavaPluginInit init)
  • Method Details

    • get

      public static BlockHealthModule get()
    • getBlockHealthSectionComponentType

      @Nonnull public ComponentType<ChunkStore, BlockHealthSection> getBlockHealthSectionComponentType()
    • onBlockReplaced

      public static void onBlockReplaced(@Nonnull ComponentAccessor<ChunkStore> accessor, @Nonnull Ref<ChunkStore> sectionRef, int index)
      Drops the health of a cell whose block was replaced. Fragility stays, because a placement marks its block fragile before the block is set.
      Parameters:
      accessor - The chunk store accessor that holds the section.
      sectionRef - The section that contains the cell.
      index - The cell index inside the section.