Plugin Version
0.9.0
Operating System
Linux (Debian/Ubuntu)
Bug Description
Faction zones configured with mob-spawn = false correctly block mob spawning during the session, but after a server restart mobs spawn freely in these zones until a zone modification triggers reapplication.
Root cause — initialization race condition:
In WorldSetup.java:103-118, initializeSpawnSuppression() calls applySpawnSuppressionToAllWorlds() synchronously and immediately. However, ZoneManager.loadAll() (lines 138-181) loads zones asynchronously via CompletableFuture. At the time spawn suppression is applied, zoneManager.getAllZones() returns an empty collection because zones haven't finished loading yet.
The zone change callback (WorldSetup.java:109-114) IS wired to re-trigger suppression when zones are modified, which is why it works during a session. But on startup, the initial zone load completion doesn't trigger this callback — only explicit modifications do.
Key files:
WorldSetup.java (lines 103-118 — calls applySpawnSuppressionToAllWorlds() before zones load)
SpawnSuppressionManager.java (lines 127-189 — applyToWorld() iterates zoneManager.getAllZones())
ZoneManager.java (lines 138-181 — async loadAll() via CompletableFuture)
Suggested fix: Chain spawn suppression application to the zone loading CompletableFuture completion, or re-apply spawn suppression after zones finish loading.
Steps to Reproduce
- Create a faction zone with
mob-spawn = false
- Verify mobs are blocked from spawning in the zone
- Restart the server
- Observe mobs spawning in the zone that should block them
Expected Behavior
Zone-level mob spawn restrictions should be enforced immediately after server restart, regardless of async zone loading order.
Plugin Version
0.9.0
Operating System
Linux (Debian/Ubuntu)
Bug Description
Faction zones configured with
mob-spawn = falsecorrectly block mob spawning during the session, but after a server restart mobs spawn freely in these zones until a zone modification triggers reapplication.Root cause — initialization race condition:
In
WorldSetup.java:103-118,initializeSpawnSuppression()callsapplySpawnSuppressionToAllWorlds()synchronously and immediately. However,ZoneManager.loadAll()(lines 138-181) loads zones asynchronously viaCompletableFuture. At the time spawn suppression is applied,zoneManager.getAllZones()returns an empty collection because zones haven't finished loading yet.The zone change callback (WorldSetup.java:109-114) IS wired to re-trigger suppression when zones are modified, which is why it works during a session. But on startup, the initial zone load completion doesn't trigger this callback — only explicit modifications do.
Key files:
WorldSetup.java(lines 103-118 — callsapplySpawnSuppressionToAllWorlds()before zones load)SpawnSuppressionManager.java(lines 127-189 —applyToWorld()iterateszoneManager.getAllZones())ZoneManager.java(lines 138-181 — asyncloadAll()via CompletableFuture)Suggested fix: Chain spawn suppression application to the zone loading CompletableFuture completion, or re-apply spawn suppression after zones finish loading.
Steps to Reproduce
mob-spawn = falseExpected Behavior
Zone-level mob spawn restrictions should be enforced immediately after server restart, regardless of async zone loading order.