Class PierceProjectile

java.lang.Object
com.hypixel.hytale.server.core.modules.projectile.component.PierceProjectile
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class PierceProjectile extends Object implements Component<EntityStore>
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.
  • Constructor Details

    • PierceProjectile

      public PierceProjectile(@Nonnull org.joml.Vector3dc origin, double maxDistance, float maxLifetimeS)
  • Method Details

    • getComponentType

      public static ComponentType<EntityStore, PierceProjectile> getComponentType()
    • markHit

      public boolean markHit(@Nonnull Ref<EntityStore> targetRef)
      Returns:
      true the 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

      @Nonnull public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.