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
[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.
LocationManagernow stores locations in aLinkedHashMap<String, Location>(insertion-ordered) instead of anArrayListscanned withstream().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 viaATOMIC_MOVE(falls back toREPLACE_EXISTINGon filesystems without atomic rename). After any crash, either the main file or.bakis 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
LocationManagerandLeaderboardManager(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);ExportWavePacketwas already safe via filename sanitization.
Observability
- Silent
catch {}blocks on critical paths (scoreboard team assign/remove/ cleanup, mob-effect parsing) now log atdebug, so failures leave a trace instead of vanishing. volatileadded to the four static manager singletons inWaveDefenseMod(read from the async save thread).
Notes
- Deferred to a later release (per scope decision):
TriggerEvaluatorgod-method refactor, removal of the two@Deprecatedlegacy editors (~3026 LOC), and pruning of ~362 unused lang keys (dynamic-key false-positive risk).