Class ProjectileModule

All Implemented Interfaces:
CommandOwner

public class ProjectileModule extends JavaPlugin
The Projectile Module implements the projectile system.
  • Field Details

  • Constructor Details

    • ProjectileModule

      public ProjectileModule(@Nonnull JavaPluginInit init)
      Default Constructor for a ProjectileModule instance.
      Parameters:
      init - The plugin initialization step for this plugin.
  • Method Details

    • get

      public static ProjectileModule get()
      Returns:
      the static instance of the ProjectileModule plugin.
    • spawnProjectile

      @Nonnull public Ref<EntityStore> spawnProjectile(Ref<EntityStore> creatorRef, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull ProjectileConfig config, @Nonnull org.joml.Vector3d position, @Nonnull org.joml.Vector3d direction)
      Called to spawn a projectile entity, returning the entity reference of the newly spawned projectile.
      Parameters:
      creatorRef - The entity reference of the instigating entities entity.
      commandBuffer - The CommandBuffer<EntityStore> for component access.
      config - The ProjectileConfig to use when spawning the projectile.
      position - The position to spawn the projectile at.
      direction - The direction to launch the projectile in.
      Returns:
      the entity reference of the newly created projectile.
    • spawnProjectile

      @Nonnull public Ref<EntityStore> spawnProjectile(Ref<EntityStore> creatorRef, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull ProjectileConfig config, @Nonnull org.joml.Vector3d position, @Nonnull org.joml.Vector3d direction, float scaleMultiplier, float speedMultiplier)
      Called to spawn an unpredicted projectile with a uniform scale multiplier on its model and hitbox (e.g. an AoE rune growing an ability projectile) and a multiplier on the config's LaunchForce (e.g. a speed rune hastening it).
    • spawnProjectile

      @Nonnull public Ref<EntityStore> spawnProjectile(@Nullable UUID predictionId, @Nullable Long scaleSeed, Ref<EntityStore> creatorRef, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull ProjectileConfig config, @Nonnull org.joml.Vector3d position, @Nonnull org.joml.Vector3d direction, long despawnDelay)
      Called to spawn a projectile entity, returning the entity reference of the newly spawned projectile.
      Parameters:
      predictionId - The UUID used for client-side prediction, or null for no prediction.
      scaleSeed - A deterministic seed for the model scale, or null for a random scale.
      creatorRef - The entity reference of the instigating entities entity.
      commandBuffer - The CommandBuffer<EntityStore> for component access.
      config - The ProjectileConfig to use when spawning the projectile.
      position - The position to spawn the projectile at.
      direction - The direction to launch the projectile in.
      Returns:
      the entity reference of the newly created projectile.
    • spawnProjectile

      @Nonnull public Ref<EntityStore> spawnProjectile(@Nullable UUID predictionId, @Nullable Long scaleSeed, Ref<EntityStore> creatorRef, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull ProjectileConfig config, @Nonnull org.joml.Vector3d position, @Nonnull org.joml.Vector3d direction, float scaleMultiplier, float speedMultiplier)
      Called to spawn a projectile entity, returning the entity reference of the newly spawned projectile.
      Parameters:
      predictionId - The UUID used for client-side prediction, or null for no prediction.
      scaleSeed - A deterministic seed for the model scale, or null for a random scale.
      creatorRef - The entity reference of the instigating entities entity.
      commandBuffer - The CommandBuffer<EntityStore> for component access.
      config - The ProjectileConfig to use when spawning the projectile.
      position - The position to spawn the projectile at.
      direction - The direction to launch the projectile in.
      scaleMultiplier - A uniform multiplier on the model scale and hitbox. Keep 1 for predicted projectiles: the predicting client spawns its twin unscaled.
      speedMultiplier - A multiplier on the config's LaunchForce. Keep 1 for predicted projectiles: the predicting client launches its twin at base speed.
      Returns:
      the entity reference of the newly created projectile.
    • spawnProjectile

      @Nonnull public Ref<EntityStore> spawnProjectile(@Nullable UUID predictionId, @Nullable Long scaleSeed, Ref<EntityStore> creatorRef, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull ProjectileConfig config, @Nonnull org.joml.Vector3d position, @Nonnull org.joml.Vector3d direction, float scaleMultiplier, float speedMultiplier, long despawnDelay)
      Called to spawn a projectile entity, returning the entity reference of the newly spawned projectile.
      Parameters:
      predictionId - The UUID used for client-side prediction, or null for no prediction.
      scaleSeed - A deterministic seed for the model scale, or null for a random scale.
      creatorRef - The entity reference of the instigating entities entity.
      commandBuffer - The CommandBuffer<EntityStore> for component access.
      config - The ProjectileConfig to use when spawning the projectile.
      position - The position to spawn the projectile at.
      direction - The direction to launch the projectile in.
      scaleMultiplier - A uniform multiplier on the model scale and hitbox. Keep 1 for predicted projectiles: the predicting client spawns its twin unscaled.
      speedMultiplier - A multiplier on the config's LaunchForce. Keep 1 for predicted projectiles: the predicting client launches its twin at base speed.
      despawnDelay - The duration in milliseconds before the projectile is despawned. 0 falls back to the default value.
      Returns:
      the entity reference of the newly created projectile.
    • getProjectileComponentType

      @Nonnull public ComponentType<EntityStore, Projectile> getProjectileComponentType()
      Returns:
      the component type for the Projectile component.
    • getStandardPhysicsProviderComponentType

      @Nonnull public ComponentType<EntityStore, StandardPhysicsProvider> getStandardPhysicsProviderComponentType()
      Returns:
      the component type for the StandardPhysicsProvider component.
    • getPredictedProjectileComponentType

      @Nonnull public ComponentType<EntityStore, PredictedProjectile> getPredictedProjectileComponentType()
      Returns:
      the component type for the PredictedProjectile component.
    • getImpactModifiersComponentType

      public ComponentType<EntityStore, ImpactModifiers> getImpactModifiersComponentType()
    • getPierceProjectileComponentType

      public ComponentType<EntityStore, PierceProjectile> getPierceProjectileComponentType()
    • getSpectralProjectileComponentType

      public ComponentType<EntityStore, SpectralProjectile> getSpectralProjectileComponentType()
    • getProjectileHitExclusionsComponentType

      public ComponentType<EntityStore, ProjectileHitExclusions> getProjectileHitExclusionsComponentType()
    • getProjectileLaunchContextComponentType

      public ComponentType<EntityStore, ProjectileLaunchContext> getProjectileLaunchContextComponentType()
    • getGroundFollowProjectileComponentType

      public ComponentType<EntityStore, GroundFollowProjectile> getGroundFollowProjectileComponentType()
    • getDirectionalHitBoxComponentType

      public ComponentType<EntityStore, DirectionalHitBox> getDirectionalHitBoxComponentType()