Klasse WaveEngine

java.lang.Object
de.delinkedde.mobarenareborn.wave.WaveEngine

public final class WaveEngine extends Object
Drives the wave loop for a running arena round.

Once started the engine spawns a wave, then ticks once per second: it prunes dead mobs and, when the wave is cleared, runs a short intermission (the safe phase) before the next, larger wave. Wave size comes from the formulas.wave-amount expression; per-mob stats are scaled by the MobScaler. The roster grows in difficulty with the wave number.

The engine is owned by an arena session, which supplies the live players and the broadcast sink, and calls stop() when the round ends to remove any remaining mobs.

  • Konstruktordetails

    • WaveEngine

      public WaveEngine(@NotNull @NotNull MobArenaPlugin plugin, @NotNull @NotNull Arena arena, @NotNull @NotNull ConfigManager config, @NotNull @NotNull MobRegistry registry, @NotNull @NotNull MobScaler scaler, @NotNull @NotNull BossRegistry bossRegistry, @NotNull @NotNull WaveSet waveSet, @NotNull @NotNull Supplier<List<Player>> playersSupplier, @NotNull @NotNull DoubleSupplier partyLevelSupplier, @NotNull @NotNull Consumer<String> broadcaster, @NotNull @NotNull ArenaHud hud, @NotNull @NotNull IntConsumer waveClearedCallback)
      Parameter:
      plugin - the owning plugin, used for scheduling
      arena - the arena being played
      config - the configuration manager
      registry - the mob registry
      scaler - the mob scaler used to spawn and scale mobs
      bossRegistry - the boss registry used on boss waves
      waveSet - the wave set defining which mobs spawn per wave
      playersSupplier - supplies the currently live players in the round
      partyLevelSupplier - supplies the party's average class level, fed to the scaling formulas
      broadcaster - receives MiniMessage strings to broadcast to the round
      hud - the heads-up display to update each tick
      waveClearedCallback - notified with the wave number each time a wave is cleared
  • Methodendetails

    • start

      public void start()
      Starts the wave loop and spawns the first wave.
    • stop

      public void stop()
      Stops the loop and removes any remaining arena mobs. Idempotent.
    • currentWave

      public int currentWave()
      Gibt zurück:
      the current wave number
    • setpieceRewardFor

      @NotNull public @NotNull Optional<ItemStack> setpieceRewardFor(int wave)
      Parameter:
      wave - the cleared wave
      Gibt zurück:
      the setpiece reward item for that wave, if configured