Class AugmentBlock

java.lang.Object
com.hypixel.hytale.builtin.augmentblocks.AugmentBlock
All Implemented Interfaces:
Component<ChunkStore>, Cloneable

public class AugmentBlock extends Object implements Component<ChunkStore>
Per-block state and config for an augment block. The upgrades list is static config declared in the block asset's BlockEntity.Components.AugmentBlock: the first entry is level 1, the second level 2, and so on (level 0 is the unupgraded default and has no entry). currentLevel is the mutable per-instance state, persisted with the block. Every participating block is indexed in the plugin's KDTree spatial resource by world position.
See Also:
  • Field Details

  • Constructor Details

    • AugmentBlock

      public AugmentBlock()
  • Method Details

    • getComponentType

      public static ComponentType<ChunkStore, AugmentBlock> getComponentType()
    • getProgressionKey

      @Nullable public String getProgressionKey()
      The universe progression entry this block writes on upgrade and restores from on load in instance copies, or null when the block doesn't participate. Levels above getMaxLevel() belong to companion systems that share the entry (e.g. the bench's native tier).
    • getProgressionLevelOffset

      public int getProgressionLevelOffset()
      How many levels of the progression entry earlier blocks in a replacement chain consumed before this block. A block placed by a ReplaceBlock upgrade sets this to the levels of the block it replaced, so the entry stays one absolute counter across the chain (e.g. broken bench: 1 = replaced by the fixed bench, 2 = the fixed bench's tier 2).
    • getRadius

      public double getRadius()
      Radius (blocks) within which this block looks up the augment blocks its requirements depend on. Also the practical bound keeping a group of augment blocks co-located: providers must sit in chunks that load together with the interacting player, or they count as offline.
    • getLevel

      @Nullable public AugmentBlockUpgradeLevel getLevel(int level)
      The upgrade for the given 1-based level, or null when the level is out of range.
    • getMaxLevel

      public int getMaxLevel()
    • getGrantsAugmentTags

      public String[] getGrantsAugmentTags()
      The grant list while at level 0. Each upgrade level's own list REPLACES this, it is not added to it.
    • collectGrantedAugmentTags

      public boolean collectGrantedAugmentTags(@Nonnull Set<String> active, @Nonnull Set<String> out)
      Adds every tag this block currently grants into out: exactly the current level's GrantsAugmentTags (the flat block-level list is level 0's). Lists replace each other level to level, so a level restates the tags it keeps and drops the rest. A level only grants while its own RequiredAugmentTags are all in active. Returns whether anything new was added, so callers can iterate to a fixpoint.
    • isMaxed

      public boolean isMaxed()
    • getCurrentLevel

      public int getCurrentLevel()
    • setCurrentLevel

      public void setCurrentLevel(int currentLevel)
    • clone

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