Contents
Class AugmentBlock
java.lang.Object
com.hypixel.hytale.builtin.augmentblocks.AugmentBlock
- All Implemented Interfaces:
Component<ChunkStore>, Cloneable
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 Summary
FieldsFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleancollectGrantedAugmentTags(Set<String> active, Set<String> out) Adds every tag this block currently grants intoout: exactly the current level'sGrantsAugmentTags(the flat block-level list is level 0's).static ComponentType<ChunkStore, AugmentBlock> intString[]The grant list while at level 0.getLevel(int level) The upgrade for the given 1-based level, or null when the level is out of range.intThe universe progression entry this block writes on upgrade and restores from on load in instance copies, or null when the block doesn't participate.intHow many levels of the progression entry earlier blocks in a replacement chain consumed before this block.doubleRadius (blocks) within which this block looks up the augment blocks its requirements depend on.booleanisMaxed()voidsetCurrentLevel(int currentLevel) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CODEC
-
-
Constructor Details
-
AugmentBlock
public AugmentBlock()
-
-
Method Details
-
getComponentType
-
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 abovegetMaxLevel()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 aReplaceBlockupgrade 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
The upgrade for the given 1-based level, or null when the level is out of range. -
getMaxLevel
public int getMaxLevel() -
getGrantsAugmentTags
The grant list while at level 0. Each upgrade level's own list REPLACES this, it is not added to it. -
collectGrantedAugmentTags
Adds every tag this block currently grants intoout: exactly the current level'sGrantsAugmentTags(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 ownRequiredAugmentTagsare all inactive. 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
- Specified by:
clonein interfaceComponent<ChunkStore>- Returns:
- a clone instance of the original component instance.
-