Wave Defense

A versatile PvE and PvP engine featuring wave defense, customizable shops, and three competitive game modes for Minecraft

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

Forge

implementation fg.deobf("curse.maven:wave-defense-1492909:7958042")
Curse Maven does not yet support mods that have disabled 3rd party sharing

Learn more about Curse Maven

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 (playerDataplayerBackupspendingDeathRestoresreEntryCooldownsleaveCountdownTicks) 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 (addPlayerToLocationtickonMobKilledsurrenderPlayersyncPlayerData, …).

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 named wd_<location>_<teamName> with Team.Visibility.HIDE_FOR_OTHER_TEAMS.
  • On leave (onPlayerLeaveendPvpMatch): player is removed from their Scoreboard team.
  • On session end (endPvpMatchclearLocation): all wd_<location>_* Scoreboard teams are removed to keep the Scoreboard clean.

Three helper methods added to PvpRoundManagerassignScoreboardTeamremoveFromScoreboardTeamcleanupScoreboardTeams.

Fixed — Missing public utility methods in WaveManager

Sub-managers (ZoneActivationManagerTriggerEvaluator) 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 when DEBUG_LOGGING_ENABLED = true).
  • debugLog(String) — writes to the server log when DEBUG_LOGGING_ENABLED = true.
  • broadcastToNearby(BlockPos, Location, String) — sends a message to all players within location.getAutoActivateRadius() blocks of a position; falls back to broadcastToLocation if the radius is 0.