Class ProjectileSpawner

java.lang.Object
me.deecaad.weaponmechanics.weapon.projectile.ProjectileSpawner
Direct Known Subclasses:
FoliaProjectileSpawner, SpigotProjectileSpawner

public abstract class ProjectileSpawner extends Object
This class is responsible for adding projectiles into some runnable.

The implementation varies depending on the server architecture. Typical Spigot/Paper servers will use 1 runnable to handle all projectile ticking. Folia servers use 1 runnable per projectile

  • Field Details

  • Constructor Details

    • ProjectileSpawner

      public ProjectileSpawner(@NotNull org.bukkit.plugin.Plugin plugin)
      Initializes the spawner with the given plugin.
      Parameters:
      plugin - The non-null plugin used to register runnables
  • Method Details

    • addScriptManager

      public void addScriptManager(@NotNull ProjectileScriptManager manager)
      Adds the given projectile manager to the list of managers. This manager will be used to attach scripts to projectiles.
      Parameters:
      manager - The non-null manager to add
    • spawn

      public abstract void spawn(@NotNull AProjectile projectile)
      Spawns the given projectile. If the thread has control over the region where the projectile is spawned, the projectile will be ticked instantly.
      Parameters:
      projectile - The non-null projectile to spawn
    • doFirstTick

      protected boolean doFirstTick(@NotNull AProjectile projectile)