Skip to content

Spawn lure mobs whenever enemies remain - #7

Merged
Drefvelin merged 1 commit into
mainfrom
fix/lure-always-spawn
Sep 29, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
fix/lure-always-spawn

Conversation

@Drefvelin

@Drefvelin Drefvelin commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A lure whose release tally runs ahead of the mobs actually in the field still spawns up to the share the clock has reached, instead of sitting on a remaining count with nothing in the fight.
  • When the spawn ring has no clear spot, the search loosens and any mobs still owed spawn at the lure. A delayed spawn that a player walks up to is moved there instead of being dropped.
  • The first mob is sent as soon as the lure activates. Kills still wait for the next paced introduction.

Test plan

  • Place a lure on open ground and confirm mobs appear on the usual pace, starting with one immediately, and stay at least min-player-distance from players.
  • Place a lure where the ring is blocked (trees, water, players covering the ring) and confirm owed mobs still appear, at the lure if needed.
  • Kill the current wave before the next pace step and confirm the hologram keeps the remaining count without instantly refilling the wave.
  • Confirm a night-only group still waits for night.
  • Reload mid-lure with remaining enemies and no loaded mobs, and confirm spawns resume up to the clock's share.

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Lure waves now account for living and pending enemies when pacing additional spawns, helping prevent lures from going empty while enemies remain.
    • Spawns can use nearby clear locations or a fallback location when preferred spots are unavailable. Spawns are canceled when no suitable fallback exists.

A release tally ahead of the live field, or a ring with no clear spot, could leave the hologram counting enemies that never appeared. Pace off the clock and the mobs actually out, and fall back to the lure when the ring cannot take them.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 211605e2-35b8-4131-9464-353e3b652dac

📥 Commits

Reviewing files that changed from the base of the PR and between 9bb6c95 and ce0fd73.

📒 Files selected for processing (6)
  • pom.xml
  • src/main/java/net/tfminecraft/infestations/infestation/Infestation.java
  • src/main/java/net/tfminecraft/infestations/infestation/InfestationManager.java
  • src/main/java/net/tfminecraft/infestations/spawn/LureSpawnQuota.java
  • src/main/java/net/tfminecraft/infestations/spawn/SpawnPlanner.java
  • src/test/java/net/tfminecraft/infestations/spawn/LureSpawnQuotaTest.java
 _______________________________________________________
< Cancel my subscriptions ... I'm tired of your issues. >
 -------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@Drefvelin
Drefvelin merged commit 318c455 into main Sep 29, 2026
1 of 2 checks passed
@Drefvelin
Drefvelin deleted the fix/lure-always-spawn branch September 29, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant