prinario

Light weight plugin called "LeafHoppers." What is it? A upgradeable hopper plugin that's insanely light weight and has GUI to upgrade the hoppers with a long config.yml meaning no restrictions

Kodari AI
KodariSep 11 at 9:30 pm 2
LeafHoppers
LeafHoppers is a lightweight upgradeable hopper plugin featuring a GUI-based upgrade system. Players place hoppers and access a chest-style interface to upgrade them through configurable tiers. The plugin uses a custom inventory GUI framework with button-based interactions, allowing players to click upgrade icons to enhance hopper speed, capacity, and filtering capabilities. A comprehensive config.yml defines all upgrade paths, costs, and permissions with no hardcoded restrictions, giving server administrators full control over progression. The plugin registers a GUI listener and manager to handle inventory events, while hopper upgrades persist through metadata and are applied in real-time. Designed for minimal server impact, it provides an intuitive upgrade experience without sacrificing performance.
  1. Create the Gradle project and plugin metadata.

  2. Add configurable hopper levels, persistent level data, placement/break handling, and transfer-speed upgrades.

  3. Add the upgrade GUI and /leafhoppers administration command.

Created the LeafHoppers plugin with:

  • Configurable upgrade levels in config.yml with 20 default levels.

  • Persistent hopper levels preserved when breaking and replacing hoppers.

  • GUI-based hopper upgrades using configurable XP costs.

  • Configurable transfer intervals.

  • Lightweight event-driven implementation without scheduled scanning.

  • /leafhoppers give <player> [level]

  • /leafhoppers reload

  • /lh alias.

  • XSeries-based material handling for cross-version compatibility.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 745
src/main/java/com/kodari/leafhoppers/LeafHoppersPlugin.java
package com.kodari.leafhoppers;

import com.kodari.leafhoppers.command.LeafHoppersCommand;
import com.kodari.leafhoppers.config.UpgradeConfig;
import com.kodari.leafhoppers.gui.HopperMenu;
import com.kodari.leafhoppers.hopper.HopperListener;
import com.kodari.leafhoppers.hopper.HopperManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class LeafHoppersPlugin extends JavaPlugin {
    private UpgradeConfig upgradeConfig;
    private HopperManager hopperManager;
    private HopperMenu hopperMenu;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        upgradeConfig = new UpgradeConfig(getConfig());
        hopperManager = new HopperManager(this, upgradeConfig);
        hopperMenu = new HopperMenu(this, hopperManager, upgradeConfig);

        Bukkit.getPluginManager().registerEvents(new HopperListener(hopperManager, hopperMenu), this);
        LeafHoppersCommand command = new LeafHoppersCommand(this, hopperManager, upgradeConfig);
        getCommand("leafhoppers").setExecutor(command);
        getCommand("leafhoppers").setTabCompleter(command);
    }

    public void reloadSettings() {
        reloadConfig();
        upgradeConfig.reload(getConfig());
    }
}