File Details
Wave-Defense-0.2.41.jar ( REFRACT Phase-1 )
- R
- Apr 20, 2026
- 591.47 KB
- 16
- 1.20.1
- Forge
File Name
wavedefense-0.2.41.jar
Supported Versions
- 1.20.1
Curse Maven Snippet
Changelog
[0.2.41] - 2026-04-20
Architecture — WaveManager refactoring (Phase 1 + 2)
WaveManager.java has been decomposed from a single 3 748-line file into 11 focused sub-managers. All per-location runtime state is now held in a single LocationSession value object instead of 30+ flat Map<String, T> fields in WaveContext. Session teardown calls LocationSession.dispose(), which clears every collection atomically — no orphaned entries, no memory leaks.
New files added to wave/:
| File | Lines | Responsibility |
|---|---|---|
LocationSession.java |
144 | Value object for all per-location state |
PortalManager.java |
~390 | Portal lifecycle, penalty waves, particles |
ZoneActivationManager.java |
~250 | Zone countdown, player collection, particles |
TriggerEvaluator.java |
~585 | Event trigger evaluation, cooldowns, firing |
InfoPanelManager.java |
~405 | TextDisplay entity create / update / remove |
PvpRoundManager.java |
~720 | PvP state machine (WAITING→BUY→COUNTDOWN→ACTIVE→ENDED) |
SessionManager.java |
~230 | Player join / surrender / victory / session end |
MobSpawnManager.java |
~225 | Mob spawn, equipment, potion effects |
WaveContext.java reduced from 157 → 115 lines: only per-player maps remain (playerData, playerBackups, pendingDeathRestores, reEntryCooldowns, leaveCountdownTicks) plus the sessions: Map<String, LocationSession> registry.
WaveManager.java reduced from 3 748 → ~1 660 lines. Now acts as a thin orchestrator: delegates all subsystem work to the managers above, exposes a uniform public API (addPlayerToLocation, tick, onMobKilled, surrenderPlayer, syncPlayerData, …).
Fixed — WAVE_COMPLETE trigger cooldown ignored (critical)
WaveManager.onWaveComplete built the trigger cooldown key as locationName + "_w" + waveIndex, but TriggerEvaluator reads/writes the key as LocationSession.triggerKey(waveIndex) → "w" + waveIndex (per-session, no location prefix). The two keys never matched, so every WAVE_COMPLETE-triggered wave fired on every wave completion regardless of the configured cooldown or oneTimeOnly flag.
// Before (wrong — key never matched session storage):
String coolKey = locationName + "_w" + wi;
// After (correct):
String coolKey = LocationSession.triggerKey(wi); // "w" + wi
Fixed — PvP teammates HUD not updating on join
WaveManager.addPlayerToPvpLocation delegated to pvpMgr but never called syncTeammates(). The PvE join path (addPlayerToLocation, line 171) has always called it. PvP players now see the full team list immediately on join.
public void addPlayerToPvpLocation(ServerPlayer player, Location location, int spawnIndex) {
pvpMgr.addPlayerToPvpLocation(this, player, location, spawnIndex);
syncTeammates(location.getName()); // ← added
}
Fixed — Duplicate team buttons in PvpTeamSelectScreen
renderTeamButtons iterated over all PvpSpawnPoint objects, creating one button per spawn point rather than per unique team name. A team with two spawn points produced two identical buttons; clicking either sent the spawn point index, but the server's auto-balance could silently override it.
Fixed with LinkedHashMap<String, Integer> teamToFirstIndex: one button per unique team name, mapped to its first spawn index.
Added — Server-side nameplate hiding via Minecraft Scoreboard (PvP)
Client-side RenderNameTagEvent suppression was already implemented. A resource pack or modified client could bypass it. PvpRoundManager now also manages Minecraft Scoreboard teams:
- On join (
addPlayerToPvpLocation): player is added to a Scoreboard team namedwd_<location>_<teamName>withTeam.Visibility.HIDE_FOR_OTHER_TEAMS. - On leave (
onPlayerLeave,endPvpMatch): player is removed from their Scoreboard team. - On session end (
endPvpMatch,clearLocation): allwd_<location>_*Scoreboard teams are removed to keep the Scoreboard clean.
Three helper methods added to PvpRoundManager: assignScoreboardTeam, removeFromScoreboardTeam, cleanupScoreboardTeams.
Fixed — Missing public utility methods in WaveManager
Sub-managers (ZoneActivationManager, TriggerEvaluator) called wm.debugAdmin(...), wm.debugLog(...), and wm.broadcastToNearby(...) which had been removed during the refactoring. Three public methods restored:
debugAdmin(String)— sends a prefixed debug message to all online operators (only whenDEBUG_LOGGING_ENABLED = true).debugLog(String)— writes to the server log whenDEBUG_LOGGING_ENABLED = true.broadcastToNearby(BlockPos, Location, String)— sends a message to all players withinlocation.getAutoActivateRadius()blocks of a position; falls back tobroadcastToLocationif the radius is 0.