Contents
Class CompanionBlockSpawnerSystems
java.lang.Object
com.hypixel.hytale.builtin.companionblockspawner.CompanionBlockSpawnerSystems
The companion block spawner's detection, claiming, and self-healing logic over
CompanionBlockSpawnerBlock
blocks (spawner blocks and requirement blocks):
CompanionBlockSpawnerSystems.AddOrRemove(event-driven fast path) reacts to participating blocks being placed/broken.CompanionBlockSpawnerSystems.ReconcileTick(slow safety net, every ~30s per block) re-validates an active spawner's marker liveness and conditions, retries activation for dormant-but-satisfiable spawners, and clears stale claims whose owner is gone - healing the states events can't reach (counterpart chunk unloaded at mutation time, same-tick placement, marker self-removal, deferred-creation races).CompanionBlockSpawnerSystems.MarkerHeartbeat(entity-store side) removes a marker (and its companions) whose origin spawner no longer exists or references it - the orphan-marker counterpart of the spawner-side liveness check.
claimedByBlock on the blocks it uses.
Recipes for one spawner key are tried in order; the first satisfiable one activates and the spawner only deactivates
when no recipe is satisfiable, so evaluating one recipe can never wipe another's claims.
The NPC itself is owned entirely by a SpawnMarkerEntity (created/removed via
CompanionBlockSpawnerSupport); these systems only decide when a marker should exist and which requirement
blocks each spawner owns.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classReacts to participating blocks being placed/broken - the event-driven fast path.static classEntity-store counterpart of the spawner-side liveness check: a marker created by a companion spawner removes itself (and its companions) when its origin spawner block no longer exists or no longer references it - so a spawner broken while the marker's chunk was unloaded can't leave an orphaned marker respawning NPCs forever.static classSlow per-block safety net (~every 30s, jittered) healing the states events can't reach: active spawner whose marker entity no longer resolves (self-removed after failed spawns, lost with a rolled-back chunk, removed while this chunk was unloaded) - clears the stale reference and re-evaluates; active spawner whose conditions silently broke (requirement removed while this chunk was unloaded) - deactivates; dormant spawner whose conditions are actually met (same-tick placement, earlier marker placement failure) - activates; requirement block claimed by a spawner that is gone or out of range - releases the claim. The first pass for a block runs a full interval after it loads, so the spatial index is warm. -
Method Summary