Contents
Class PierceProjectile
java.lang.Object
com.hypixel.hytale.server.core.modules.projectile.component.PierceProjectile
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
Marks a projectile as piercing: an entity contact runs the hit chain for that entity
(once per entity) without stopping the flight. The projectile ends after covering
maxDistance from its origin or after maxLifetimeS seconds, whichever
comes first, instead of on first hit. Pair with SpectralProjectile to also fly
through blocks.-
Field Summary
Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionPierceProjectile(org.joml.Vector3dc origin, double maxDistance, float maxLifetimeS) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadvanceAndCheckExpired(float dt) Advances the projectile's age and reports whether its lifetime is over.clone()static ComponentType<EntityStore, PierceProjectile> booleanisBeyondMaxDistance(org.joml.Vector3dc position) booleanmarkHit(Ref<EntityStore> targetRef) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Constructor Details
-
PierceProjectile
public PierceProjectile(@Nonnull org.joml.Vector3dc origin, double maxDistance, float maxLifetimeS)
-
-
Method Details
-
getComponentType
-
markHit
- Returns:
truethe first time the given entity is hit by this projectile.
-
isBeyondMaxDistance
public boolean isBeyondMaxDistance(@Nonnull org.joml.Vector3dc position) -
advanceAndCheckExpired
public boolean advanceAndCheckExpired(float dt) Advances the projectile's age and reports whether its lifetime is over. -
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-