
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
209
4
Список изменений
[1.5.1] — 2026-04-20 — Code Quality & Performance Patch
Fixed / Improved — ZoneManager
- WorldGuard region cache —
getApplicableRegions()was called for every mob on every monitor tick. Queries are now cached per chunk with a 100-tick TTL (ConcurrentHashMap). Cache is invalidated automatically when TTL expires, eliminating excessive WorldGuard API pressure on large servers. - CuboidZone coords changed from
doubletoint— block-level precision is sufficient; int arithmetic is faster and the record is more memory-efficient. - Zone
initialize()now clears the WG cache on reload.
Fixed / Improved — ProfileManager
- Profile validation before apply — switching to a profile where
critical-tps ≥ medium-tpsormax-entities < 1now returns a clear error instead of silently corrupting the engine state. - Active profile persisted across restarts — the selected profile name is written to
plugins/NeuroLag/active-profile.daton switch and reloaded automatically on startup/reload, so profiles survive server restarts without manual re-selection. switchProfile()return type changed frombooleantoString(null = success,"NOT_FOUND"or error message = failure) — NeuroLag main command updated accordingly.
Fixed / Improved — PredictiveScheduler
- Hand-rolled JSON parser replaced with Gson (bundled by Paper) — the previous
split/replaceAllparser was fragile and could silently produce wrong data on corrupt files. Gson provides safe serialisation and clean error handling; corrupt files now log a warning instead of producing garbage hourly averages. - Loaded samples are capped to the last 60 per hour on load, not only on record.
Fixed / Improved — CpuMonitor
- Graceful fallback for non-Sun JVMs — if
com.sun.management.OperatingSystemMXBeanis unavailable (GraalVM, some container JVMs), the monitor now falls back toOperatingSystemMXBean.getSystemLoadAverage()normalised by CPU count. If even that is unavailable, the feature disables itself gracefully instead of throwing at construction time. - EMA smoothing (α = 0.3) — single-tick CPU spikes no longer toggle the throttle on/off erratically. The exponential moving average keeps the reading stable under transient load.
- Strategy (SUN_PROCESS / SYSTEM_LOAD / DISABLED) is selected once at construction and
stored in an enum — no repeated
instanceofchecks every tick.
Fixed / Improved — RegionOptimizer
- Player chunk position cache —
refresh()now tracks each player's last known chunk. The HOT/COLD region map is only rebuilt when at least one player has moved to a different chunk since the previous call. On a stable server this eliminates the full-player-scan every monitor tick. isBeyondPathfindingDistance()uses the cached positions instead of callingworld.getPlayers()a second time per mob check.
Fixed / Improved — NeuroLagAPI
- Added
NeuroLagAPI.getInstance()for cleaner third-party plugin integration. - JSON payload sent via plugin message channel now uses Gson instead of manual StringBuilder, eliminating potential escape bugs.
Fixed / Improved — LagReporter (Discord)
- Retry with exponential back-off — Discord webhook requests are retried up to 3 times (delays: 1 s → 2 s → 4 s) before giving up. Transient network errors and Discord 429 rate-limit responses no longer silently drop notifications.
- Discord embed payload now built with Gson — no more manual string escaping.
Fixed / Improved — StressTestManager
- Confirmation prompt for spawns > 1 000 mobs — the sender must repeat the command within 30 seconds to confirm. Prevents accidental large spawns.
- Multiple entity types —
stress-test.entity-typesconfig list (default: ZOMBIE, SKELETON, CREEPER) is cycled round-robin across spawned mobs, producing a more realistic mixed load. Invalid or non-spawnable type names log a warning and are skipped.
Fixed / Improved — LagEngine
- Added internal processing metrics:
lastTickMobCountandlastTickProcessingMs. Visible in/nlag status("Last Tick: N mobs, X ms"). ZoneManager.tick()is now called once per engine tick to advance the WG cache TTL counter.
Fixed / Improved — WebDashboard
- Rate limiting now also covers
GET /(the HTML dashboard page), not only/api/*endpoints. - Token auto-generation log output upgraded to
SEVERElevel and formatted as a clearly visible bordered block so admins cannot miss the new token in the console.
Fixed / Improved — ConfigManager / ConfigValidator
- Added
stress-test.entity-typeslist field. ConfigValidatornow checksentity-typeslist is non-empty when stress test is enabled.
Config changes (systems.yml)
stress-test:
entity-types: # NEW — 1.5.1
- ZOMBIE
- SKELETON
- CREEPER
Файлы
NeuroLag-1.5.1.jar(5.56 MiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
1.5.1
Загрузчики
PaperPurpur
Версии игры
1.5.1
Загрузок
3
Дата публикации
2 нед. назад
