erik_segway1

.

Kodari AI
KodariMay 29 at 2:26 pm 2

I’ll create a comprehensive auto-sell plugin with harvester hoe functionality, mob sword upgrades, and a full GUI shop system.

RivalCore
A modular SkyBlock core plugin featuring upgradeable harvester hoes, mob swords, and pickaxes with custom enchants. Includes an auto-sell system, GUI-based upgrade menus, and economy integration via Vault. Players can level up tools through kills and block breaks, unlock passive abilities, and manage earnings through a polished inventory UI. Designed for seamless SkyBlock server integration.

Let me plan the architecture before writing a single line:

Classes to create:

  • RivalCore — main plugin, registers managers

  • ConfigManager — loads/caches config values

  • HarvesterHoe — item creation, upgrade logic, block-break listener

  • MobSword — item creation, upgrade logic, kill listener

  • PickaxeItem — item creation, upgrade logic, mine listener

  • AutoSellManager — handles auto-sell on block break/kill

  • ShopGUI — paginated buy/sell GUI

  • UpgradeGUI — tool upgrade menu

  • PlayerDataManager — stores per-player tool data (YAML)

  • Commands — /rivalcore, /hoe, /sword, /pickaxe, /shop

  • ItemBuilder — utility for building ItemStacks

Building from scratch:

[Generation stopped]

Kodari can make mistakes. Review important code before using.
Files
src
Code
2 157
src/main/java/com/rivalmc/rivalcore/RivalCore.java
package com.rivalmc.rivalcore;

import com.rivalmc.rivalcore.commands.CoreCommand;
import com.rivalmc.rivalcore.commands.HoeCommand;
import com.rivalmc.rivalcore.commands.PickaxeCommand;
import com.rivalmc.rivalcore.commands.ShopCommand;
import com.rivalmc.rivalcore.commands.SwordCommand;
import com.rivalmc.rivalcore.gui.ShopGUI;
import com.rivalmc.rivalcore.gui.UpgradeGUI;
import com.rivalmc.rivalcore.listeners.HarvesterHoeListener;
import com.rivalmc.rivalcore.listeners.MobSwordListener;
import com.rivalmc.rivalcore.listeners.PickaxeListener;
import com.rivalmc.rivalcore.managers.AutoSellManager;
import com.rivalmc.rivalcore.managers.ConfigManager;
import com.rivalmc.rivalcore.managers.PlayerDataManager;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public class RivalCore extends JavaPlugin {

    @Getter private static RivalCore instance;
    @Getter private ConfigManager configManager;
    @Getter private PlayerDataManager playerDataManager;
    @Getter private AutoSellManager autoSellManager;
    @Getter private ShopGUI shopGUI;
    @Getter private UpgradeGUI upgradeGUI;
    @Getter private Economy economy;

    @Override
    public void onEnable() {
        instance = this;

        if (!setupEconomy()) {
            getLogger().severe("Vault economy not found — disabling RivalCore.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        configManager = new ConfigManager(this);
        playerDataManager = new PlayerDataManager(this);
        autoSellManager = new AutoSellManager(this);
        shopGUI = new ShopGUI(this);
        upgradeGUI = new UpgradeGUI(this);

        registerListeners();
        registerCommands();

        getLogger().info("RivalCore enabled.");
    }

    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        getLogger().info("RivalCore disabled.");
    }

    private boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) return false;
        RegisteredServiceProvider<Economy> rsp =
                getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) return false;
        economy = rsp.getProvider();
        return economy != null;
    }

    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new HarvesterHoeListener(this), this);
        getServer().getPluginManager().registerEvents(new MobSwordListener(this), this);
        getServer().getPluginManager().registerEvents(new PickaxeListener(this), this);
    }

    private void registerCommands() {
        getCommand("rivalcore").setExecutor(new CoreCommand(this));
        getCommand("hoe").setExecutor(new HoeCommand(this));
        getCommand("sword").setExecutor(new SwordCommand(this));
        getCommand("pickaxe").setExecutor(new PickaxeCommand(this));
        getCommand("shop").setExecutor(new ShopCommand(this));
    }
}