notbritish64

make me a java plugin that is a 0 Compermise back end optimisation plugin like it is lithium. please do not effect anything that the player can tell, make sure it help without anything like redstone and mob spawning changes, please just help optimise the backend of the server

Kodari AI
KodariJul 13 at 6:40 am 24

I’ll build a genuine backend-only optimizer: fast empty-chunk unloading, TPS monitoring, and offline-player lookup caching — nothing that touches redstone, mob spawning, or anything a player would notice.

InvisibleOptimizer
A zero-compromise backend optimization plugin inspired by Lithium's philosophy but built for Bukkit/Paper. Speeds up the server without changing any player-visible behavior: no redstone changes, no mob spawning changes. Includes fast empty-chunk unloading to save memory, a lightweight TPS monitor with admin-only alerts, and an offline-player lookup cache to avoid blocking disk IO. Ships with /backendopt admin command for status, reload, and chunk stats.

Built exactly to your constraint — no redstone, no mob-spawning, no visible gameplay changes:

  • ChunkOptimizerModule — expedites unloading of empty, unforced chunks outside every player’s view distance (and never touches spawn-protected chunks). Pure memory reclaim; chunks reload transparently the instant they’re needed.

  • TPSMonitorModule — passive tick-time tracking, only reports low TPS to admins with the invisibleoptimizer.notify permission. Never alters behavior.

  • LookupCacheModule — caches OfflinePlayer name/UUID lookups to eliminate blocking disk IO stalls on the main thread.

  • /backendopt status|reload|chunks for admins (invisibleoptimizer.admin, default op).

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 540
src/main/java/com/kodari/invisibleoptimizer/InvisibleOptimizer.java
package com.kodari.invisibleoptimizer;

import com.kodari.invisibleoptimizer.commands.BackendOptCommand;
import com.kodari.invisibleoptimizer.listeners.LookupCacheListener;
import com.kodari.invisibleoptimizer.modules.ChunkOptimizerModule;
import com.kodari.invisibleoptimizer.modules.LookupCacheModule;
import com.kodari.invisibleoptimizer.modules.TPSMonitorModule;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class InvisibleOptimizer extends JavaPlugin {

    private ConfigManager configManager;
    private ChunkOptimizerModule chunkOptimizer;
    private TPSMonitorModule tpsMonitor;
    private LookupCacheModule lookupCache;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.chunkOptimizer = new ChunkOptimizerModule(this);
        this.tpsMonitor = new TPSMonitorModule(this);
        this.lookupCache = new LookupCacheModule(this);

        chunkOptimizer.start();
        tpsMonitor.start();
        lookupCache.start();

        getServer().getPluginManager().registerEvents(new LookupCacheListener(this), this);

        BackendOptCommand command = new BackendOptCommand(this);
        getCommand("backendopt").setExecutor(command);
        getCommand("backendopt").setTabCompleter(command);

        getLogger().info("InvisibleOptimizer enabled - optimizing backend performance with zero gameplay impact.");
    }

    @Override
    public void onDisable() {
        if (chunkOptimizer != null) {
            chunkOptimizer.stop();
        }
        if (tpsMonitor != null) {
            tpsMonitor.stop();
        }
        if (lookupCache != null) {
            lookupCache.stop();
        }
    }

    public ConfigManager cfg() {
        return configManager;
    }

    public void restartModules() {
        chunkOptimizer.stop();
        tpsMonitor.stop();
        lookupCache.stop();
        chunkOptimizer.start();
        tpsMonitor.start();
        lookupCache.start();
    }
}