▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
NeuroLag

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

46
1
Все версииNeuroLag 1.3.0

NeuroLag 1.3.0

Release1 нед. назад

Список изменений

[1.3.0] — 2026-03-15

🐛 Bug Fixes (9 fixes)

BUG-A — ZoneManager: world name dropped from cuboid zones (cross-world contamination)

  • Root cause: ZoneManager.initialize() parsed zone entries as "world x1 y1 z1 x2 y2 z2" (7 parts) but stored only parts[1]..parts[6] in a raw double[], silently discarding parts[0] (the world name).
  • Effect: A zone defined in world survival would also protect mobs at the same coordinates in world_nether, world_the_end, and any other loaded world. Mobs in unintended worlds were immune to optimization.
  • Fix: Replaced List<double[]> with List<CuboidZone> where CuboidZone is a Java record holding String world + 6 coordinates. isProtected() now checks mob.getWorld().getName().equals(z.world()) before testing coordinates.

BUG-B — RegionOptimizer: negative chunk coordinates mapped to wrong region

  • Root cause: Region index was computed as chunkX / regionSize using Java integer division, which truncates toward zero. Chunk -1 / 16 = 0 and chunk 1 / 16 = 0, so chunks in the negative quadrant near spawn mapped to the same region keys as their positive counterparts.
  • Effect: The HOT region around coordinate origin (0,0) was effectively double-sized. Mobs at negative chunk coordinates near spawn were optimized even when a player was present nearby.
  • Fix: Replaced / with Math.floorDiv() in both refresh() and isHot(). Math.floorDiv(-1, 16) = -1 (correct), Math.floorDiv(15, 16) = 0 (correct).

BUG-C — DashboardManager: type: HOLOGRAM silently did nothing

  • Root cause: DashboardManager.start() returned early with if (!dashboardType.equals("BOSSBAR")) return — no log message, no error. Admins who set dashboard.type: HOLOGRAM saw no dashboard and received no indication why.
  • Fix: Added an explicit plugin.getLogger().warning() message when a non-BOSSBAR type is configured, clearly stating that only BOSSBAR is currently supported.

BUG-D — BackupManager: creationTime() unreliable on Linux (ext4)

  • Root cause: Backup rotation used Files.readAttributes(...).creationTime() to sort backups oldest-first. The ext4 filesystem does not store inode creation time — it returns Instant.EPOCH (1970-01-01) for all files, making sort order undefined.
  • Effect: On Linux servers, the "oldest" backup was selected randomly. The wrong backup could be deleted or restored.
  • Fix: Replaced creationTime() with Files.getLastModifiedTime(), which is reliably stored on all filesystems. Also removed the now-unused BasicFileAttributes import.

BUG-E — StressTestManager: always spawned at world[0] spawn, ignoring admin's location

  • Root cause: start() hardcoded Bukkit.getWorlds().get(0).getSpawnLocation() as the spawn center regardless of where the admin was or which world they were in.
  • Effect: Running /nlag stresstest from the Nether or End spawned mobs in the Overworld at spawn, making the test meaningless for other worlds.
  • Fix: start() now accepts a CommandSender parameter. If the sender is a Player, mobs spawn centered on the player's current location in their current world. Console fallback remains world[0] spawn.

BUG-F — WebDashboard: POST /api/cmd blocked by CORS preflight (OPTIONS)

  • Root cause: Browsers send an HTTP OPTIONS preflight request before a cross-origin POST. The server had no handler for OPTIONS and returned 405 Method Not Allowed, causing the browser to abort the actual POST.
  • Effect: The "send command" button in external web dashboards or REST clients always failed silently.
  • Fix: Added sendCorsOptions() helper that returns 204 No Content with Access-Control-Allow-Methods: GET, POST, OPTIONS and Access-Control-Allow-Headers: Authorization, Content-Type. Both /api/status and /api/cmd now handle OPTIONS before auth checks.

BUG-G — AuditManager: getLivingEntities() / getLoadedChunks() called on main thread

  • Root cause: snapshot() iterated all entities and chunks synchronously on the main thread before handing off to async write.
  • Effect: On servers with many mobs or chunks, this could stall the main thread for several milliseconds during audit generation.
  • Mitigation: Added an explicit code comment documenting this limitation and the reason it is required by the Bukkit API. A full async snapshot would require a thread-safe entity iterator not currently available in Paper's public API.

BUG-H — ProfileManager: clearProfile() required a full cfg.reload() to restore values

  • Root cause: switchProfile() overwrote cfg.tpsCritical, cfg.tpsMedium, and cfg.maxEntities directly. clearProfile() only set activeProfile = null and left a comment saying "caller is responsible for reloading", which NeuroLag.java implemented by calling cfg.reload() + engine.restoreAll() + startMonitor() — a heavy operation that re-read disk and restarted all tasks.
  • Fix: ProfileManager now saves the three base values in saveBaseValues() (called in the constructor and after every cfg.reload()). clearProfile() restores them directly — no reload required. /nlag profile clear no longer triggers a full config reload cycle.

BUG-I — LagEngine: "Animation Freezing" comment/name mismatched actual behavior

  • Root cause: Feature F4 was named "Animation Freezing" throughout the codebase, but the implementation only called mob.setVelocity(0,0,0). This stops movement drift but does not freeze animation frames — mobs still visibly idle-animate.
  • Fix: Renamed the in-code comment to "Velocity Freeze" and added a note explaining that true animation-frame control requires NMS/packet-level access not available through the standard Bukkit API.

🔧 Other Changes

  • plugin.yml: version bumped to 1.3.0; permission descriptions clarified; neurolag.stresstest description now mentions mobs spawn at your location
  • pom.xml: version bumped to 1.3.0
  • StressTestManager.start() signature changed to start(int count, int durationMinutes, CommandSender sender) — callers updated in NeuroLag.java
  • ProfileManager.saveBaseValues() is now public so NeuroLag.java can call it after /nlag reload

Файлы

NeuroLag-1.3.0.jar(5.81 MiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

1.3.0

Загрузчики

Bukkit
Paper
Purpur
Spigot

Версии игры

1.21–1.21.11

Загрузок

24

Дата публикации

1 нед. назад

Загрузил

ID версии

Главная