atomicnaimv10

nake a plugin which is resourcepack loader which will self host on server insted of merging it will load frist resourcepack thand 2nd resourcepack thats how it will work insted of merging system 1 by one pack will be laoded

Kodari AI
KodariAug 7 at 12:07 am 1
SequentialPackLoader
A Minecraft plugin that self-hosts resource packs on the server. Instead of merging multiple packs into one, it loads resource packs sequentially one after another. The plugin serves each pack via an internal HTTP server and applies them to players in order, ensuring the first pack loads completely before the second begins. This approach avoids complex merging logic and maintains pack integrity while providing a simple, reliable way to deliver multiple resource packs to clients.
  1. Create the Gradle project and plugin metadata.

  2. Add a self-hosted HTTP server that serves ZIP packs from the plugin data folder.

  3. Add join/status handling to send packs sequentially, one at a time.

  4. Add admin commands and configuration for reloading and manually starting the sequence.

Created the ResourcePackLoader plugin with:

  • Embedded self-hosted HTTP server for resource-pack ZIP files.

  • Alphabetical pack ordering.

  • Sequential loading: pack 1 completes before pack 2 is sent.

  • SHA-1 hash support for each pack.

  • Automatic loading on player join.

  • Admin commands:

    • /rploader reload

    • /rploader load <player>

    • /rploader status

  • Configurable bind address, port, public URL, pack directory, and messages.

  • Resource packs stored in plugins/ResourcePackLoader/resourcepacks/.

atomicnaimv10

self hosted for paper server make sure

Kodari AI
KodariAug 7 at 12:08 am 1
  1. Switch the build target from Spigot API to Paper API.

  2. Keep the embedded HTTP server inside the Paper plugin process and make the configuration explicitly server-hosted.

  3. Preserve sequential loading and update plugin metadata for Paper.

Updated the plugin specifically for Paper Server:

  • Uses paper-api:1.20.4-R0.1-SNAPSHOT.

  • Uses Paper’s Maven repository.

  • Keeps the HTTP server embedded inside the Paper plugin.

  • Resource packs are hosted from: plugins/ResourcePackLoader/resourcepacks/

  • Packs load sequentially: first pack completes, then the next starts.

  • Updated configuration comments to clarify port forwarding and public URL requirements.

Set this in config.yml:

YAML
public-url: http://YOUR_SERVER_IP:8167

Make sure port 8167 is open and forwarded to the Minecraft server. Players must be able to access that URL from outside the server network.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 592
src/main/java/com/kodari/resourcepackloader/ResourcePackLoader.java
package com.kodari.resourcepackloader;

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.IOException;
import java.util.Objects;

public final class ResourcePackLoader extends JavaPlugin implements Listener {

    private ResourcePackManager packManager;
    private PackHttpServer httpServer;
    private PackSessionManager sessionManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        packManager = new ResourcePackManager(this);
        try {
            packManager.reload();
        } catch (IOException exception) {
            getLogger().severe("Could not load the resource pack directory: " + exception.getMessage());
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        httpServer = new PackHttpServer(this, packManager);
        try {
            httpServer.start();
        } catch (IOException exception) {
            getLogger().severe("Could not start the resource pack HTTP server: " + exception.getMessage());
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        sessionManager = new PackSessionManager(this, packManager, httpServer);
        getServer().getPluginManager().registerEvents(this, this);
        Objects.requireNonNull(getCommand("resourcepackloader")).setExecutor(
                new ResourcePackCommand(this, packManager, sessionManager)
        );

        getLogger().info("Loaded " + packManager.getPackCount() + " resource pack(s).");
        getLogger().info("Serving resource packs at " + httpServer.getBaseUrl());
    }

    @Override
    public void onDisable() {
        if (sessionManager != null) {
            sessionManager.clear();
        }
        if (httpServer != null) {
            httpServer.stop();
        }
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        if (getConfig().getBoolean("load-on-join", true)) {
            Bukkit.getScheduler().runTask(this, () -> sessionManager.start(event.getPlayer()));
        }
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        sessionManager.remove(event.getPlayer().getUniqueId());
    }

    @EventHandler
    public void onResourcePackStatus(PlayerResourcePackStatusEvent event) {
        sessionManager.handleStatus(event.getPlayer(), event.getStatus());
    }
}