Contents
Class CompanionBlockSpawnerBlock
java.lang.Object
com.hypixel.hytale.builtin.companionblockspawner.CompanionBlockSpawnerBlock
- All Implemented Interfaces:
Component<ChunkStore>, Cloneable
A block-entity marker placed (via the block type's
BlockEntity config) on every block that
participates in a CompanionBlockSpawnerRecipe -
both spawner blocks and requirement blocks. Indexed in a KDTree spatial resource
so the companion block spawner systems can find participating blocks near a placed/broken block.
Two role-specific pieces of state live here (each only meaningful for one role):
markerRef(spawner blocks) - the spawn marker the spawner currently owns while active. The marker handles the companion NPC (spawn, respawn on death, despawn, reload re-linking); removing it despawns the companion.claimedByBlock(requirement blocks) - the world position of the spawner block that has exclusively claimed this requirement. A requirement may be claimed by at most one spawner, so spawners can't share it.
-
Field Summary
FieldsFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()org.joml.Vector3ibooleanvoidResets the countdown to the reconcile interval with jitter, spreading reconciles across blocks so they don't all run on the same tick.voidsetClaimedByBlock(org.joml.Vector3i claimedByBlock) voidsetMarkerRef(PersistentRef markerRef) booleantickReconcileCountdown(float dt) Ticks the reconcile countdown; returnstruewhen a reconcile pass is due.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CODEC
-
-
Constructor Details
-
CompanionBlockSpawnerBlock
public CompanionBlockSpawnerBlock()
-
-
Method Details
-
getComponentType
-
getMarkerRef
-
setMarkerRef
-
hasMarker
public boolean hasMarker() -
getClaimedByBlock
@Nullable public org.joml.Vector3i getClaimedByBlock() -
setClaimedByBlock
public void setClaimedByBlock(@Nullable org.joml.Vector3i claimedByBlock) -
tickReconcileCountdown
public boolean tickReconcileCountdown(float dt) Ticks the reconcile countdown; returnstruewhen a reconcile pass is due. The caller is expected toresetReconcileCountdown()afterwards. -
resetReconcileCountdown
public void resetReconcileCountdown()Resets the countdown to the reconcile interval with jitter, spreading reconciles across blocks so they don't all run on the same tick. -
clone
- Specified by:
clonein interfaceComponent<ChunkStore>- Returns:
- a clone instance of the original component instance.
-