ChunkManager

ChunkManager

Plugin

Optimizes chunk loading to reduce server lag.

Server ManagementOptimization

2,775 downloads
12 followers
Follow Save
Filter loader...
Filter versions...

Bug Fixes:

  • Fixed "Comparison method violates its general contract" error when players disconnect
  • Improved chunk unloading stability
  • Fixed ANSI color codes in console (reverted to avoid Bukkit warnings)

Improvements:

  • Better memory cleanup on player disconnect

Bug Fixes

  • Fixed critical sorting issue that caused IllegalArgumentException: Comparison method violates its general contract! during chunk unloading operations
  • The smart chunk unloader now captures heat values before sorting to ensure comparison consistency
  • This prevents crashes that could occur when the server was processing chunk unload tasks

Details

  • Resolved race condition in SmartChunkUnloader.identifyColdChunks() where volatile heat values could change during sort operations
  • Improved stability of chunk management system under high load conditions

Small Patch:

  • Removed "Safe Teleporting" causing issues.

✅ 1. Multi-threaded Chunk Processing

  • Created ChunkProcessor with dynamic thread pool management
  • Priority-based task queue (CRITICAL, HIGH, NORMAL, LOW)
  • Automatic thread scaling based on workload
  • Async chunk loading/unloading operations

✅ 2. Chunk Teleportation Safety

  • Created TeleportationSafety component
  • Pre-loads chunks before teleporting players
  • Validates destination safety (no lava, fire, etc.)
  • Fall damage protection after teleport
  • Configurable timeout and radius

✅ 3. Multi-language Support (10+ languages)

  • Created LanguageManager with 10 languages:
    • English, Spanish, French, German, Portuguese
    • Italian, Russian, Japanese, Korean, Chinese
  • Added /chunklang command
  • Auto-generates language files on first run
  • Hot-swappable languages without restart

✅ 4. Smart Unloading Algorithm

  • Created SmartChunkUnloader with heat map tracking
  • Tracks player movement patterns and predicts chunk needs
  • Heat decay system for intelligent unloading
  • Protects important chunks (villagers, named entities)
  • Priority-based unloading of "cold" chunks

Additional Improvements:

  • Enhanced memory management with object pooling
  • Added a API for plugin integration
  • Enhanced config.yml with new feature settings (DELETE YOUR ON Config.yml)
  • Fixed maintenance mode toggle bug
  • Improved config reload behavior
  • Enhanced UI display
  • Added auto-maintenance state persistence
  • Fixed state restoration during server restarts

Changelog

Enhancements

  • Dynamic Radius Handling: Improved and made configurable in the config.yml file.
  • Maintenance Mode: Automatically switches on/off based on performance thresholds.

Fixes & Improvements

  • Chunk Management: Fully skips chunk management for blacklisted worlds, improving efficiency.
  • Code Cleanup: Reorganized and cleaned up the codebase for improved stability.
  • Safety Checks: Added new safeguards around chunk loading and unloading to prevent errors.
  • Task Management: Introduced graceful task cancellation during plugin shutdown.

[+] Maintenance Mode: Introduced a new feature that lets you enable or disable a lower chunk loading radius for better performance.

[/] Made some side improvements for better functionality.

[+] Enhanced /chunksummary command with detailed world info (total players, entities, etc.).

[+] Added support for 4 languages (English, Spanish, French, Chinese)

[-] Removed clearlag functionality. _(from version 1.0.7)

[/] Fixed asynchronous access issues by ensuring all Bukkit API calls run on the main thread.

Change Log for Version 1.0.5

Added

  • New /clearlag command to manually clear unnecessary entities.
  • Automatic entity clearing with customizable intervals.
  • Countdown timer warnings before automatic clearing.

Improved

  • /optimizechunks logic for more accurate chunk unloading.
  • Memory usage display to ensure accurate reporting.
  • Message format for better clarity and professionalism.

Release on modrinth, original post SpigtMC


Project members

TheeCobra

Member

Details

Licensed MIT
Published a year ago
Updated 2 months ago