
NeuroLag
A smart, resource-aware optimization plugin that dynamically adjusts Mob AI based on server TPS and RAM to ensure a lag-free SMP experience
Список изменений
[1.0.6] — 2025-03-11
Fixed
-
Bug — Tick-Rate Throttling (Feature 2) never activated
InapplyAiBatched,shouldHaveAiwas alwaystruefor MEDIUM state becauseglobalAiOn = !state.equals("CRITICAL")evaluates totrue. The throttle condition!shouldHaveAiwas therefore alwaysfalse, so distant mobs in MEDIUM were silently given full AI instead of being throttled.
Fix: chunk proximity is now evaluated independently first. Near-player mobs always get full AI; distant mobs in MEDIUM state enter the throttle queue; CRITICAL mobs getsetAI(false)as intended. -
Bug —
/nlag toggledid not actually pause monitoring
SettingmanualOverride = truehad no effect ontick()— the scheduler task continued running. Fix:monitorTask.cancel()is now called when pausing;startMonitor()is called when resuming (existing behaviour). -
Bug —
/nlag simulate clearthrewNumberFormatException
Tab-complete suggested"clear"as a valid argument, but the code passed it directly toDouble.parseDouble(), crashing with an unhandled exception.
Fix: an explicitequalsIgnoreCase("clear")check now runs before the parse. -
Minor — Recovery (NORMAL) action bar could be suppressed by cooldown
The 5-second notify cooldown was applied to all state transitions, including CRITICAL → NORMAL recovery. If a CRITICAL message had just been sent, admins would miss the recovery notification entirely.
Fix: cooldown only throttles MEDIUM/CRITICAL spam; NORMAL recovery always fires. -
Minor —
notifyTimesmap not cleared onrestoreAll()
Stale cooldown timestamps persisted across/nlag reloadand plugin restarts, causing the first post-reload notification to be silently dropped.
Fix:notifyTimes.clear()added torestoreAll().
[1.0.5] — 2025-03-10
Added
-
Feature 1 — Chunk-Based AI Throttling
Mobs within a configurable chunk radius of any online player always retain their AI, even in CRITICAL state. Only mobs in truly unobserved chunks are disabled. Controlled bychunk-ai.enabledandchunk-ai.distance-chunks. -
Feature 2 — Tick-Rate Throttling
In MEDIUM state, instead of hard-disabling mob AI, a dedicated per-tick task cycles through distant mobs and enables their AI for exactly 1 tick every N ticks. Mobs appear sluggish rather than completely frozen, which feels far more natural in-game. Controlled bytick-throttle.enabledandtick-throttle.ticks-per-ai-tick. -
Feature 3 — Spawn Rate Suppression
During MEDIUM or CRITICAL lag, world monster and animal spawn caps are temporarily lowered to reduce new mob generation. Limits are fully restored on recovery. Controlled byspawn-suppression.*. -
Feature 4 — Per-Player Action Bar Notification
When a player has affected mobs within a configurable radius, they receive a personal action bar message explaining why nearby mobs seem different. Previously only ops received any notification. Controlled byper-player-notify.*. -
Feature 5 —
/nlag simulate <tps>
Overrides the TPS value used by the engine without affecting the real server. Allows admins to test threshold configurations, Discord alerts, and reports without needing actual server lag. Running/nlag simulatewith no argument clears the override. -
Feature 6 — Auto Lag Reports
After recovering from a CRITICAL event that lasted longer thanmin-duration-seconds, a timestamped report is written toplugins/NeuroLag/lag-reports/. Each report includes world name, duration, lowest TPS reached, recovery TPS, affected mob count, online player count, and JVM heap statistics. -
Feature 7 — Entity Whitelist
SpecificEntityTypenames can be added totargets.whitelist-typesto permanently exempt them from all optimization and culling. Additionally,protect-named-mobsandprotect-tamed-mobsoptions prevent NeuroLag from touching player pets, named mobs, and boss entities. -
Feature 8 — Discord Webhook
Posts a rich Discord embed when a world enters CRITICAL lag and when it recovers. The recovery embed includes total CRITICAL duration and the lowest TPS reached. Uses Java 11+HttpClient— no external library required. Controlled bydiscord.*. -
Feature 9 — Memory Pressure Detection
Reads JVM heap usage ratio at each TPS check. When heap exceedstrigger-percent, an additional offset is subtracted from effective TPS before threshold evaluation, causing NeuroLag to act more aggressively when RAM is nearly exhausted. Controlled bymemory-pressure.*. -
Feature 10 — Player-Count Scaling
TPS thresholds are linearly scaled upward as the number of online players increases betweenmin-playersandmax-players. At maximum players, all thresholds shift up bymax-threshold-offsetTPS. Per-world threshold overrides are scaled the same way. Controlled byplayer-scaling.*. -
/nlag simulatetab-completion — suggests common TPS values (5, 10, 15, 18, 20). -
Heap stats in
/nlaghelp panel and/nlag status— shows used/max MB and percentage. -
World state icons in
/nlag status—●NORMAL,▲MEDIUM,✖CRITICAL. -
/nlag togglenow callsrestoreAll()before resuming the monitor, ensuring any frozen mobs are immediately unfrozen.
