I

can you separate the gui of transaction and your items? do not make it the same as with the auction house and also add a auction navigation for both transaction and your items navigation in it's gui

Kodari AI
KodariSep 4 at 10:37 pm 2
  1. Separate transaction and “your items” into dedicated auction GUIs.

  2. Add navigation controls linking auction house, transactions, and your items in each relevant GUI.

The transaction and items views now have their own content and navigation controls; I’m correcting the auction-house control row so it keeps both existing destinations while only the secondary views receive the return-to-auction button.1. Separated navigation for the auction views in AuctionManager:

  • Auction House: Transactions + Your Items

  • Transactions: Your Items + Auction House

  • Your Items: Transactions + Auction House

  1. Added a configurable Auction House navigation button in auction.yml:

    • Default slot: 46

    • Default material: EMERALD

  2. Added click handling so the new Auction House button returns players to /ah.

The transaction and your-items inventories already render their own distinct content and titles; they no longer use the same navigation controls as the main auction view.

I

Can you make this plugin a lightweight plugin? Make sure it doesnt break anything that causes spam error on the console or either causing player ping goes high up or causing bugs on the player or even causing TPS drop and MSPT goes high up.

Kodari AI
KodariSep 7 at 10:07 pm 4
  1. Audit the plugin for high-frequency work, repeated tasks, unsafe event handling, and console-error sources.

  2. Patch only proven performance and stability issues while preserving existing behavior.

  3. Verify the changed code paths for null safety, task cancellation, and duplicate registration.

Implemented a lightweight-performance pass focused on reducing TPS/MSPT spikes and console issues:

  • Auction House

    • Moved auction YAML disk writes off the main server thread.

    • Coalesced rapid auction saves into one asynchronous save.

    • Added periodic expiration cleanup instead of checking and saving on every GUI open.

    • Cached auction listing sorting so it only sorts after listings change.

    • Removed repeated cleanup and sorting during purchases and item claims.

    • Preserved synchronous saving during plugin shutdown.

  • Shard system

    • Cached player shard balances to avoid repeated SQLite reads.

    • Fixed shard removal to perform only one balance lookup.

    • Cached leaderboard results for five seconds.

    • Invalidated leaderboard cache after balance changes.

    • Moved fallback YAML writes to a delayed asynchronous save.

    • Preserved final shutdown saving.

  • Player settings

    • Coalesced settings saves and moved file writes asynchronously.

    • Prevented repeated rapid setting changes from rewriting the file every click.

    • Added a final synchronous save during shutdown.

  • Sell All

    • Changed it from scanning the inventory once per configured material to scanning the inventory once total.

These changes reduce unnecessary disk I/O, repeated sorting, repeated database queries, and inventory scans without changing the plugin’s visible behavior.

zy_furi

can you make the shard system when I deleted the shard database or any sort of data that sorts all the player shards will be automatically reset since the current one is still keeping the shard even I already deleted the data of the shards

Kodari AI
KodariSep 20 at 9:29 am 1
  • Make the SQLite database the authoritative shard source.

  • Stop repopulating an empty/new database from shard-data.yml or legacy YAML.

  • When shards.db is missing at startup, clear the backup shard data too so deleted databases reset all balances.

Updated the shard system so the SQLite database is now the only authoritative source for shard balances.

Changes:

  • Deleting shards.db and restarting the server creates a fresh empty database.

  • Old balances from shard-data.yml are no longer imported into a new database.

  • The backup shard data is cleared automatically when the database is missing.

  • Empty or manually cleared database records now correctly return 0 shards.

  • Removed the old migration behavior that restored deleted balances from YAML.

The reset takes effect when the plugin starts. Deleting the database while the server is running requires a server/plugin restart because the database connection is already open.

zy_furi

make all the feature of this plugin has its own sound effect when opening, clicking items (make sure it is the item inside the gui, do not make any sound when clicking on the gui) and closing the gui, apply this to all features and I also want you to add a sound effect when teleporting to a warp, separate this .yml so that it wont needed to generate a new one and I also want you to add a navigation.yml for auction since some of the navigation are missing and I want you to put all navigation on it

Kodari AI
KodariSep 20 at 9:38 am 4
  1. Map every GUI/open-click-close path and existing sound/config handling.

  2. Add centralized configurable GUI sounds, playing only for valid GUI item clicks.

  3. Add configurable warp-teleport sound without creating duplicate config files.

  4. Move auction navigation into navigation.yml and cover all auction views/links.

  • Centralize GUI sounds in sounds.yml, keyed by GUI type and lifecycle (open, click, close).

  • Handle sounds in CoreListener so every current GUI is covered, while clicks on empty GUI slots stay silent.

  • Add a warp-completion sound and load it from the separate sound file.

  • Move auction page controls and auction-view buttons into a new navigation.yml; keep titles/announcements in auction.yml.

Implemented configurable sounds and separated auction navigation into its own file.

Added sounds.yml

Every GUI now has configurable sounds for:

  • Opening

  • Clicking an actual item

  • Closing

Covered GUI features:

  • Auction House

  • Transactions

  • Your Items

  • Shop

  • Shop purchase confirmation

  • Sell menu

  • Shard shop

  • Shard leaderboard

  • Settings

Empty GUI slots do not play sounds. Click sounds only play when the clicked slot contains an item.

You can disable any sound by setting it to:

YAML
NONE

Added warp teleport sound

A configurable sound now plays after a successful warp teleport, including instant teleports:

YAML
warp-teleport: ENTITY_ENDERMAN_TELEPORT

Added navigation.yml

All auction navigation is now separated from auction.yml, including:

  • Previous page

  • Next page

  • Close

  • Auction House

  • Transactions

  • Your Items

auction.yml now only contains auction titles and announcements.

The new files are loaded without overwriting existing player configurations, so server owners can safely customize them.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
33 2,780
src/main/java/com/kodari/donutcore/DonutCore.java
package com.kodari.donutcore;

import com.kodari.donutcore.auction.AuctionManager;
import com.kodari.donutcore.command.CoreCommand;
import com.kodari.donutcore.economy.EconomyService;
import com.kodari.donutcore.gui.CoreListener;
import com.kodari.donutcore.shop.SellManager;
import com.kodari.donutcore.shop.ShopManager;
import com.kodari.donutcore.shards.ShardManager;
import com.kodari.donutcore.settings.SettingsManager;
import com.kodari.donutcore.warp.WarpManager;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.configuration.InvalidConfigurationException;

import java.io.IOException;
import java.io.File;
import java.util.Map;
import java.util.HashMap;

public class DonutCore extends JavaPlugin {
    private EconomyService economyService;
    private ShardManager shardManager;
    private AuctionManager auctionManager;
    private ShopManager shopManager;
    private SellManager sellManager;
    private WarpManager warpManager;
    private SettingsManager settingsManager;
    private FileConfiguration leaderboardConfig;
    private FileConfiguration auctionConfig;
    private FileConfiguration settingsMenuConfig;
    private FileConfiguration shopConfig;
    private FileConfiguration sellConfig;
    private FileConfiguration shardsConfig;
    private FileConfiguration indicatorConfig;
    private FileConfiguration soundsConfig;
    private FileConfiguration navigationConfig;
    private final Map<String, FileConfiguration> shopCategoryConfigs = new java.util.LinkedHashMap<>();
    private final Map<String, File> shopCategoryFiles = new HashMap<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("leaderboard.yml", false);
        saveResource("auction.yml", false);
        saveResource("navigation.yml", false);
        saveResource("sounds.yml", false);
        saveResource("settings.yml", false);
        new File(getDataFolder(), "shops").mkdirs();
        saveResource("shops.yml", false);
        String[] shopCategories = {"blocks", "nether", "redstone", "food", "end"};
        for (String category : shopCategories) {
            saveResource("shops/" + category + ".yml", false);
        }
        saveResource("sell.yml", false);
        saveResource("shards.yml", false);
        saveResource("indicator.yml", false);
        leaderboardConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "leaderboard.yml"));
        auctionConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "auction.yml"));
        navigationConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "navigation.yml"));
        soundsConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "sounds.yml"));
        settingsMenuConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "settings.yml"));
        shopConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "shops.yml"));
        loadShopCategories();
        sellConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "sell.yml"));
        shardsConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "shards.yml"));
        indicatorConfig = loadIndicatorConfig();
        RegisteredServiceProvider<Economy> registration = getServer().getServicesManager().getRegistration(Economy.class);
        if (registration == null || registration.getProvider() == null) {
            getLogger().severe("Vault economy was not found. CloudCore is disabled.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        economyService = new EconomyService(registration.getProvider());
        shardManager = new ShardManager(this);
        auctionManager = new AuctionManager(this, economyService);
        shopManager = new ShopManager(this, economyService);
        sellManager = new SellManager(this, economyService);
        warpManager = new WarpManager(this);
        settingsManager = new SettingsManager(this);

        CoreCommand command = new CoreCommand(this);
        String[] commands = {"ah", "shop", "cshop", "sell", "shards", "shard", "shardshop", "warp", "warps", "setwarp", "nv", "nightvision", "settings"};
        for (String name : commands) {
            if (getCommand(name) != null) {
                getCommand(name).setExecutor(command);
                getCommand(name).setTabCompleter(command);
            }
        }
        getServer().getPluginManager().registerEvents(new CoreListener(this), this);
        if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
            new DonutExpansion(this).register();
        }
    }

    @Override
    public void onDisable() {
        if (auctionManager != null) auctionManager.saveData();
        if (settingsManager != null) settingsManager.saveData();
        if (shardManager != null) {
            shardManager.saveData();
            shardManager.close();
        }
    }

    public String message(String key, Map<String, String> replacements) {
        String value = getConfig().getString("messages." + key, key);
        value = value.replace("%prefix%", getConfig().getString("messages.prefix", ""));
        if (replacements != null) {
            for (Map.Entry<String, String> entry : replacements.entrySet()) {
                value = value.replace("%" + entry.getKey() + "%", entry.getValue());
            }
        }
        if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
            value = me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(null, value);
        }
        return ChatColor.translateAlternateColorCodes('&', value);
    }

    public void send(CommandSender sender, String key, Map<String, String> replacements) {
        sender.sendMessage(message(key, replacements));
    }

    public FileConfiguration settings() {
        return getConfig();
    }

    public FileConfiguration leaderboard() { return leaderboardConfig; }
    public FileConfiguration auction() { return auctionConfig; }
    public FileConfiguration navigation() { return navigationConfig; }
    public FileConfiguration sounds() { return soundsConfig; }
    public FileConfiguration settingsMenu() { return settingsMenuConfig; }
    public FileConfiguration shopConfig() { return shopConfig; }
    public FileConfiguration sellConfig() { return sellConfig; }
    public FileConfiguration shardsConfig() { return shardsConfig; }
    public FileConfiguration indicator() { return indicatorConfig; }
    public FileConfiguration shopCategory(String category) { return shopCategoryConfigs.get(category.toLowerCase()); }
    public File shopCategoryFile(String category) { return shopCategoryFiles.get(category.toLowerCase()); }
    public java.util.List<String> shopCategories() { return new java.util.ArrayList<>(shopCategoryConfigs.keySet()); }

    public EconomyService economy() { return economyService; }
    public ShardManager shards() { return shardManager; }
    public AuctionManager auctions() { return auctionManager; }
    public ShopManager shop() { return shopManager; }
    public SellManager sell() { return sellManager; }
    public WarpManager warps() { return warpManager; }
    public SettingsManager settingsManager() { return settingsManager; }

    public void playGuiSound(org.bukkit.entity.Player player, com.kodari.donutcore.gui.MenuHolder.Type type, String action) {
        String key;
        switch (type) {
            case AUCTION: key = "auction"; break;
            case AUCTION_TRANSACTIONS: key = "auction-transactions"; break;
            case AUCTION_ITEMS: key = "auction-items"; break;
            case SHOP: key = "shop"; break;
            case SHOP_CONFIRM: key = "shop-confirm"; break;
            case SELL: key = "sell"; break;
            case SHARD_SHOP: key = "shard-shop"; break;
            case SHARD_LEADERBOARD: key = "shard-leaderboard"; break;
            case SETTINGS: key = "settings"; break;
            default: return;
        }
        playSound(player, "gui." + key + "." + action);
    }

    public void playWarpSound(org.bukkit.entity.Player player) {
        playSound(player, "warp-teleport");
    }

    private void playSound(org.bukkit.entity.Player player, String path) {
        String soundName = soundsConfig == null ? null : soundsConfig.getString(path);
        if (soundName == null || soundName.trim().isEmpty() || "NONE".equalsIgnoreCase(soundName)) return;
        com.cryptomorin.xseries.XSound.matchXSound(soundName).ifPresent(sound -> sound.play(player));
    }

    private FileConfiguration loadIndicatorConfig() {
        FileConfiguration config = new YamlConfiguration();
        File file = new File(getDataFolder(), "indicator.yml");
        try {
            config.load(file);
        } catch (IOException | InvalidConfigurationException ignored) {
            config.set("survival.prefix", "&cSurvival");
            config.set("creative.prefix", "&9Creative");
        }
        return config;
    }

    private void loadShopCategories() {
        shopCategoryConfigs.clear();
        shopCategoryFiles.clear();
        org.bukkit.configuration.ConfigurationSection categories = shopConfig.getConfigurationSection("shop.categories");
        if (categories == null) return;

        File folder = new File(getDataFolder(), "shops");