Wave Defense

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

File Details

wavedefense-0.2.66.jar

  • R
  • Jun 19, 2026
  • 1.14 MB
  • 100
  • 1.20.1
  • Forge

File Name

wavedefense-0.2.66.jar

Supported Versions

  • 1.20.1

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:wave-defense-1492909:8278419")

Learn more about Curse Maven

[0.2.66] - 2026-06-19 — Hardening, performance & robustness pass

A senior-modder / server-ops audit drove a round of correctness, performance, and durability fixes. No new gameplay features — this is a stability release focused on production-server safety. No data-format changes (existing wavedefense_locations.dat / leaderboard files load unchanged).

Performance

  • O(1) location lookup. LocationManager now stores locations in a LinkedHashMap<String, Location> (insertion-ordered) instead of an ArrayList scanned with stream().filter()getLocation() was called from 73 sites, several on per-tick hot paths — now constant-time.
  • getAllLocations() returns a defensive copy in creation order, closing the mutable-internal-list encapsulation leak (all callers are read-only).

Durability

  • Atomic file writes (NbtHelper.atomicWriteCompressed): serialize to .tmp, move current file to .bak, then commit .tmp → main via ATOMIC_MOVE (falls back to REPLACE_EXISTING on filesystems without atomic rename). After any crash, either the main file or .bak is always valid — corruption can no longer wipe all locations.
  • Async + debounced saves (NbtHelper.atomicWriteCompressedAsync): disk I/O moves off the server thread onto a daemon executor, and bursts of saves (admin spam-clicking Save, fast tab switches, round-end leaderboard writes) collapse into a single write per 1 s window. Server stop flushes synchronously so nothing is lost on shutdown. The serialization snapshot is taken eagerly on the server thread, so there is no read-during-write race.
  • Per-entry load resilience: a single malformed location entry is now skipped + logged instead of aborting the whole file load.
  • Data-version migration hook scaffolded in LocationManager and LeaderboardManager (migrate(tag, fromVersion)) — v0→v1 is a no-op, but the seam exists for future schema changes.

Security

  • Rate limits added to seven previously-unprotected packets: UpdateLocationPacket (500 ms), ReplaceShopItemsPacket (100 ms/chunk), BulkAddShopItemsPacket (500 ms), ImportLocationPacket (2 s), RequestLocationDataPacket (1 s), UpdatePlayerSettingsPacket (500 ms), ReadyCheckPacket (250 ms) — closes a packet-flood DoS surface.
  • Path-traversal guard added to ExportLocationPacket (canonical-path check); ExportWavePacket was already safe via filename sanitization.

Observability

  • Silent catch {} blocks on critical paths (scoreboard team assign/remove/ cleanup, mob-effect parsing) now log at debug, so failures leave a trace instead of vanishing.
  • volatile added to the four static manager singletons in WaveDefenseMod (read from the async save thread).

Notes

  • Deferred to a later release (per scope decision): TriggerEvaluator god-method refactor, removal of the two @Deprecated legacy editors (~3026 LOC), and pruning of ~362 unused lang keys (dynamic-key false-positive risk).