Dyar Saeed

DraftSMP-Chunky — Ultimate Development Specification

Develop a complete, standalone, professional Minecraft Paper plugin named DraftSMP-Chunky, inspired by the functionality of chunk pre-generation tools, with an original implementation, architecture, commands, configuration system, and user experience.

  1. Project Requirements
  • Plugin name: "DraftSMP-Chunky"
  • Version: "1.0.0"
  • Main command: "/dchunky"
  • Alias: "/dc"
  • Platform: Paper 1.21.11 and newer compatible versions
  • Language: Java
  • Build system: Maven
  • Deliver a working, installation-ready JAR and the complete editable source project.

The plugin must feel like a carefully handcrafted project created by an experienced developer. Use clean, maintainable Java code, meaningful class names, appropriate comments, proper error handling, and a professional architecture. Do not produce pseudocode, incomplete implementations, or fake features.

  1. Chunk Pre-Generation

Implement reliable chunk pre-generation with:

  • Circular and square generation regions.
  • Configurable center X/Z coordinates and radius.
  • World selection, including custom worlds, Nether, and End.
  • Configurable generation speed and processing limits.
  • Start, pause, resume, cancel, and status controls.
  • Progress percentage, processed chunks, total chunks, elapsed time, and estimated remaining time.
  • Duplicate-task prevention and safe cancellation.
  • World-border integration.
  • Configurable task priorities and generation order.
  • Safe operation on large worlds without unnecessary server lag.
  1. Automatic Startup and Recovery

Provide configurable automatic startup behavior:

  • Resume unfinished generation tasks after restart.
  • Automatically start selected generation jobs.
  • Save progress regularly and restore it after crashes or restarts.
  • Configure startup delays and generation speed.
  • Process multiple worlds independently.
  • Prevent duplicate tasks and repeated unnecessary work.
  • Gracefully save task state during server shutdown.

Already generated chunks must remain saved in the world. Resuming generation must skip completed work whenever possible.

  1. Chunk Loading

Implement optional persistent chunk-loading management:

  • Define permanent loading regions by world and coordinates.
  • Restore configured loading regions after restart.
  • Configure maximum loaded chunks and loading priorities.
  • Support controlled loading and unloading.
  • Track chunks managed by this plugin.
  • Never unload chunks owned by other systems or interfere with unrelated plugins.
  • Clearly distinguish pre-generation from keeping chunks loaded in memory.
  1. Fully Customizable Configuration

Create a comprehensive configuration system with separate files:

  • "config.yml" — general settings, performance, generation, startup, limits, and feature toggles.
  • "messages.yml" — every command message, prefix, error, notification, and progress display.
  • "worlds.yml" — per-world settings, generation regions, exclusions, and loading rules.
  • "tasks.yml" — saved generation tasks and automatic startup jobs.
  • "storage.yml" — storage format, saving intervals, recovery, and data-management options.

Every reasonable setting must be configurable without recompiling the plugin. Include clear comments, sensible defaults, validation, and automatic creation of missing configuration files.

Support configurable colors, MiniMessage formatting where appropriate, progress-bar characters, notification intervals, debug logging, language messages, and permission requirements.

Implement "/dchunky reload" to reload supported configuration files safely without corrupting running tasks.

  1. Commands

Implement the following commands with proper argument validation and tab completion:

  • "/dchunky help"
  • "/dchunky start"
  • "/dchunky pause"
  • "/dchunky resume"
  • "/dchunky cancel"
  • "/dchunky status"
  • "/dchunky generate"
  • "/dchunky load"
  • "/dchunky unload"
  • "/dchunky worlds"
  • "/dchunky tasks"
  • "/dchunky info"
  • "/dchunky reload"

Provide arguments for world, coordinates, radius, region shape, speed, and task identification. The "/dc" alias must support all the same functionality.

  1. Permissions

Implement granular permissions:

  • "draftsmpchunky.admin"
  • "draftsmpchunky.generate"
  • "draftsmpchunky.load"
  • "draftsmpchunky.unload"
  • "draftsmpchunky.status"
  • "draftsmpchunky.reload"

Configure sensible operator defaults and ensure unauthorized players cannot execute restricted commands.

  1. Progress Display

Provide customizable progress reporting through chat and console, including:

  • Current world and generation region.
  • Completion percentage and progress bar.
  • Processed and total chunks.
  • Current generation speed.
  • Elapsed time and estimated remaining time.
  • Current task state and errors.

Allow all messages and reporting intervals to be changed in "messages.yml" and "config.yml".

  1. Performance and Reliability
  • Follow Paper API threading rules.
  • Avoid blocking the main server thread with large workloads.
  • Use safe, bounded task scheduling and configurable throttling.
  • Validate all coordinates, world names, radii, and user input.
  • Handle missing worlds, corrupted task data, and unexpected shutdowns gracefully.
  • Avoid excessive CPU, RAM, disk, and server-tick usage.
  • Use safe storage and recovery mechanisms.
  • Never modify or delete unrelated world data.
  • Ensure thread-safe cancellation and task recovery.
  1. Technical Quality

Use the correct Paper API for each supported version. Declare dependencies and Java requirements accurately. Do not assume that compiling against one version guarantees compatibility with every newer release.

Include:

  • Complete Java source code.
  • "pom.xml" with reproducible build configuration.
  • Correct "plugin.yml".
  • All default configuration files.
  • README with installation, commands, permissions, and examples.
  • Build instructions.
  • A compiled JAR ready to install.

Test compilation, plugin initialization, configuration loading, command registration, generation start/pause/resume/cancel, persistence, restart recovery, and chunk-loading cleanup.

Final Acceptance Criteria

The finished plugin must be a functional, original chunk pre-generation and management system, not a visual mockup. Every advertised feature must actually work. No empty methods, missing dependencies, unresolved compilation errors, or unimplemented configuration options.

Build and test the project before delivery. Provide the complete source project and the compiled JAR, and clearly document which Paper versions have actually been tested.

The final result must be named "DraftSMP-Chunky" and provide a professional, flexible alternative for Minecraft server administrators who need reliable chunk pre-generation, automatic task recovery, and configurable chunk-loading management.

Kodari AI
KodariOct 22 at 12:51 pm 2
DraftSMPChunky
A comprehensive Minecraft Paper plugin for chunk pre-generation and management. Features circular and square generation regions with configurable center coordinates, radius, world selection, speed controls, and task priorities. Implements automatic startup and crash recovery with progress persistence across restarts. Provides optional persistent chunk-loading management with configurable loading regions and priorities. Includes a fully customizable configuration system with separate YAML files for general settings, messages, worlds, tasks, and storage. Commands include start, pause, resume, cancel, status, generate, load, unload, worlds, tasks, info, and reload with tab completion. Granular permissions system with six distinct permission levels. Real-time progress display with percentage, progress bars, processed chunks, speed, elapsed time, and ETA. Built for performance with bounded task scheduling, thread-safe operations, and safe cancellation. Supports Paper 1.21.11+ with Maven build system and installation-ready JAR.
  1. Create the Maven/Paper plugin entry point, configuration, messages, and command registration.

  2. Implement resumable asynchronous pre-generation, persistent chunk-loading regions, permissions, and progress reporting.

  3. Add installation and usage documentation; compilation and JAR download are handled by Kodari’s Compile workflow.

Created the DraftSMP-Chunky Maven source project with asynchronous chunk generation, pause/resume/cancel and recovery, circular or square regions, world-border checks, configurable exclusions and generation order, progress reporting, commands and permissions, and persistent loading regions that manage only this plugin’s chunk tickets.

The project targets Paper 1.21.11+ and Java 21. I haven’t run compilation or server integration tests in this session, so those versions are targets, not tested compatibility claims. Loading regions load existing chunks without generating absent ones.

To build and download the JAR in Kodari:

  1. Click Compile in the desktop top bar, or on phone tap ⋮ → Compile Project.

  2. Click Compile in the window.

  3. When it succeeds, click Download for the build or Download DraftSMP-Chunky.jar in chat.

Dyar Saeed

Platform and Multithreading Requirements

  • Support Paper only, starting from Minecraft 1.21.11 and newer compatible Paper versions.
  • Do not support Spigot, Bukkit-only servers, Fabric, Forge, or Folia.
  • Implement safe multithreading wherever appropriate to improve chunk pre-generation performance.
  • Follow Paper API thread-safety rules strictly. Never access or modify world data asynchronously unless the specific API explicitly permits it.
  • Use controlled asynchronous task processing, configurable concurrency limits, and safe synchronization.
  • Keep all unsafe Bukkit/Paper world operations on the appropriate server thread.
  • Make thread count and workload limits configurable where practical.
Kodari AI
KodariOct 22 at 12:53 pm 1
  1. Keep all world access on Paper’s server thread and use Paper’s async chunk API for generation.

  2. Make the in-flight generation cap configurable globally and per world, while retaining bounded per-tick dispatch.

  3. Document that custom worker threads are intentionally avoided because Paper owns chunk-generation threading.

Updated DraftSMP-Chunky to require Paper 1.21.11+, reject other server platforms at startup, and explicitly mark Folia unsupported. Generation continues to use Paper’s asynchronous chunk API, with configurable global and per-world in-flight limits plus a per-tick submission cap. World operations remain on the server thread; the plugin doesn’t create its own worker pool because Paper controls async chunk-generation threads.

I haven’t compiled or runtime-tested these changes in this session.

Dyar Saeed

كملته؟

Kodari AI
KodariOct 22 at 12:53 pm 1

نعم، اكتملت التعديلات المطلوبة. لكن لم أُجرِ compile أو اختبارًا داخل اللعبة، لذلك لم أتحقق من البناء أو التشغيل.

Dyar Saeed

حسنا هل ربطت multithreading

Kodari AI
KodariOct 22 at 12:56 pm 1

نعم، ربطت التوليد بواجهة Paper غير المتزامنة لتحميل/توليد الـchunks، مع حدود قابلة للضبط لعدد المهام المتزامنة. Paper يدير خيوط العمل بنفسه؛ لم أُنشئ thread pool خاصًا، لتجنّب الوصول غير الآمن إلى بيانات العالم خارج خيط السيرفر.

Dyar Saeed

يعني ربطت ال multithreading مع ال paper

Kodari AI
KodariOct 22 at 12:56 pm 1

نعم، ربطته بـ Paper عبر واجهة توليد/تحميل الـchunks غير المتزامنة. Paper هو الذي يدير خيوط العمل، مع حدود للتوازي؛ أما التعامل مع بيانات العالم فيبقى على خيط السيرفر حسب قواعد السلامة.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
14 1,437
src/main/java/com/draftsmp/chunky/DraftSMPChunky.java
package com.draftsmp.chunky;

import com.draftsmp.chunky.command.ChunkyCommand;
import com.draftsmp.chunky.generation.ChunkTaskManager;
import com.draftsmp.chunky.loading.ChunkLoadingManager;
import com.draftsmp.chunky.message.MessageService;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;

public final class DraftSMPChunky extends JavaPlugin {
    private MessageService messages;
    private YamlConfiguration worldsConfig;
    private YamlConfiguration tasksConfig;
    private YamlConfiguration storageConfig;
    private ChunkTaskManager taskManager;
    private ChunkLoadingManager loadingManager;

    @Override
    public void onEnable() {
        if (!"Paper".equalsIgnoreCase(Bukkit.getName())) {
            getLogger().severe("DraftSMP-Chunky requires Paper 1.21.11 or newer and does not support other server platforms.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
        saveDefaultConfig();
        ensureResource("messages.yml");
        ensureResource("worlds.yml");
        ensureResource("tasks.yml");
        ensureResource("storage.yml");
        loadPersistentConfigurations();
        messages = new MessageService(this);
        taskManager = new ChunkTaskManager(this);
        loadingManager = new ChunkLoadingManager(this);
        ChunkyCommand command = new ChunkyCommand(this);
        getCommand("dchunky").setExecutor(command);
        getCommand("dchunky").setTabCompleter(command);
        taskManager.start();
        loadingManager.start();
        taskManager.scheduleRecovery();
        getLogger().info("DraftSMP-Chunky enabled.");
    }

    @Override
    public void onDisable() {
        if (taskManager != null) {
            taskManager.shutdown();
        }
        if (loadingManager != null) {
            loadingManager.shutdown();
        }
    }

    public void reloadRuntimeConfiguration() {
        reloadConfig();
        messages.reload();
        storageConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "storage.yml"));
    }

    private void ensureResource(String name) {
        if (!new File(getDataFolder(), name).exists()) {
            saveResource(name, false);
        }
    }

    private void loadPersistentConfigurations() {
        File folder = getDataFolder();
        worldsConfig = YamlConfiguration.loadConfiguration(new File(folder, "worlds.yml"));
        tasksConfig = YamlConfiguration.loadConfiguration(new File(folder, "tasks.yml"));
        storageConfig = YamlConfiguration.loadConfiguration(new File(folder, "storage.yml"));
    }

    public void saveWorldsConfig() {
        saveYaml(worldsConfig, "worlds.yml");
    }

    public void saveTasksConfig() {
        saveYaml(tasksConfig, "tasks.yml");
    }

    private void saveYaml(YamlConfiguration yaml, String name) {
        try {
            yaml.save(new File(getDataFolder(), name));
        } catch (IOException exception) {
            getLogger().severe("Could not save " + name + ": " + exception.getMessage());
        }
    }

    public boolean canUse(org.bukkit.command.CommandSender sender, String permission) {
        return sender.hasPermission("draftsmpchunky.admin") || sender.hasPermission(permission);
    }

    public MessageService messages() {
        return messages;
    }

    public YamlConfiguration worldsConfig() {
        return worldsConfig;
    }

    public YamlConfiguration tasksConfig() {
        return tasksConfig;
    }

    public YamlConfiguration storageConfig() {
        return storageConfig;
    }

    public ChunkTaskManager taskManager() {
        return taskManager;
    }

    public ChunkLoadingManager loadingManager() {
        return loadingManager;
    }
}