LegacyProjectileSystems
Package: com.hypixel.hytale.server.core.modules.entity
public class LegacyProjectileSystemsContainer class for ECS systems that manage legacy projectile entities. These systems handle projectile initialization, validation, and per-tick physics/lifecycle processing. All inner systems operate on EntityStore and are registered by EntityModule during setup.
Inner Classes
Section titled “Inner Classes”OnAddHolderSystem
Section titled “OnAddHolderSystem”public static class OnAddHolderSystem extends HolderSystem<EntityStore>Initialization system triggered when a projectile entity is added to the store. Performs the following setup:
- Assigns a
NetworkIdif the archetype does not already contain one. - Calls
ProjectileComponent.initialize(). - Attempts to load the model from
ModelAsset.getAssetMap()using the projectile’s appearance key. If a model is found, sets upModelComponentandPersistentModelcomponents, and derives the bounding box from the model. - If no model is found, falls back to the
Projectileasset’s radius/height for the bounding box, or defaults to 0.25x0.25x0.25. - Sets
BoundingBoxon the entity and initializes physics.
Queries for entities matching the ProjectileComponent component type.
OnAddRefSystem
Section titled “OnAddRefSystem”public static class OnAddRefSystem extends RefSystem<EntityStore>Validation system that runs after a projectile entity is added. If the ProjectileComponent’s getProjectile() returns null (indicating failed initialization), logs a warning and removes the entity.
Queries for entities matching the ProjectileComponent component type.
TickingSystem
Section titled “TickingSystem”public static class TickingSystem extends EntityTickingSystem<EntityStore> implements DisableProcessingAssertPer-tick physics and lifecycle system for projectile entities. On each tick:
- Checks if the projectile’s dead timer has expired via
consumeDeadTimer(dt). If so, callsonProjectileDeath()and removes the entity. - Otherwise, ticks the
SimplePhysicsProviderwith the entity’sVelocity, world,TransformComponent, and command buffer. - If a physics tick throws an exception, logs the error and removes the entity.
Queries for entities matching the archetype of ProjectileComponent, TransformComponent, Velocity, and BoundingBox.
Related Types
Section titled “Related Types”- EntityModule — registers all three projectile systems during setup
- BlockEntitySystems — similar system container for block entities
- DespawnSystem — another entity lifecycle system
ProjectileComponent— the ECS component these systems operate onBoundingBox— bounding box component initialized during setupModelComponent— visual model set when a model asset is available