nyxara19

add additional command /shards giveall <amount> (it gives all players who's online a shards)

Kodari AI
KodariSep 1 at 4:21 am 1
  • Add giveall parsing and online-player shard distribution.

  • Update /shards usage text and tab completion.

Added /shards giveall <amount>.

  • Grants the specified shard amount to every online player.

  • Requires donutcore.shards.give.

  • Validates that the amount is a positive integer.

  • Reports how many online players received the shards.

  • Added giveall tab completion.

  • Updated the command usage in plugin.yml.

nyxara19

I also want you to add a feature where it show the transaction you have at the auction house and also add "your items" that sorts those expired items that didnt sell for 2 days and make sure that it doesnt cause any spam console error and data loss of it

Kodari AI
KodariSep 1 at 4:28 am 3
  1. Inspect the auction-house transaction flow and add a transaction view.

  2. Add “Your Items” handling for unsold listings expired for 2 days.

  3. Harden loading/saving and expiry processing against console spam and data loss.

  • Use a persisted auction ledger with separate active listings, expired claimable items, and player transaction records.

  • Add GUI buttons plus /ah transactions and /ah youritems entry points.

  • Move expired listings into “Your Items” at expiry, retain them until claimed, and use rollback-safe atomic saves for create, purchase, expiry, and claiming.

The core auction views and rollback-safe persistence are in place. I’m checking the economy and plugin shutdown paths now so offline seller payouts and final saves cannot silently lose state.

I found two reliability gaps to close: offline sellers were never paid, and auction state was not explicitly flushed during plugin shutdown. I’m fixing both, plus making malformed YAML entries and runtime save failures recoverable without repeated stack traces.

Implemented the auction-house transaction and item recovery features.

  • Added /ah transactions and /ah history.

  • Added /ah youritems and /ah items.

  • Added GUI buttons for Your Transactions and Your Items.

  • Transactions now record:

    • Purchases

    • Sales

    • Expired listings

  • Listings that expire after the configured duration (default: 48 hours / 2 days) are moved into Your Items.

  • Players can claim expired items directly from the GUI.

  • Offline sellers now receive their sale payment through Vault.

  • Added atomic auction-data saving using a temporary file to reduce corruption and data loss.

  • Auction data is saved when the plugin disables.

  • Failed saves roll back the related transaction, item removal, or payment.

  • Malformed auction entries are skipped without stack-trace spam.

  • Save warnings are rate-limited to prevent console spam.

  • Updated /ah usage and tab completion.

nyxara19

Also can you fix the sell? instead that it shows the sellable items at the gui, make it not show, only the chest at the center that sell all sellable items at your inventory to make it clean

Kodari AI
KodariSep 1 at 4:37 am 1
  1. Simplify the sell GUI to display only the central chest.

  2. Keep the chest action selling every sellable item in the player’s inventory.

  3. Remove the now-unused per-item display code and imports.

Updated the sell GUI:

  • Removed all individual sellable-item icons.

  • The GUI now shows only one Sell All chest in the center slot.

  • Clicking the chest sells every configured sellable item from the player’s inventory.

  • Removed the old per-item selling behavior and unused imports.

nyxara19

I also want you to add a feature on shop that you can buy per items or a stack items like 1 stack just like the feature of economyshopgui plugin, make sure that it is compatible with bedrock players since they dont have cursor on mobile

Kodari AI
KodariSep 1 at 4:41 am 2
  1. Inspect the existing shop GUI, purchase flow, pricing, and Bedrock detection support.

  2. Add per-item and per-stack purchase actions without relying on cursor placement.

  3. Keep the GUI clean and prevent clicks from moving items or producing errors.

  • Add an explicit purchase-selection menu with Buy 1 and Buy 1 Stack buttons.

  • Calculate stack pricing from each item’s configured unit price.

  • Validate the item before charging, refund on inventory overflow, and cancel GUI drags for Bedrock-safe interaction.

Updated the shop purchase flow:

  • Clicking a shop item now opens a clean purchase menu instead of buying immediately.

  • Added Buy 1 and Buy 1 Stack buttons.

  • Stack purchases always buy 64 items.

  • Prices are calculated per item from the configured item price and amount.

  • Invalid shop items are detected before charging.

  • Players are refunded if their inventory cannot fit the purchase.

  • Added a Back button.

  • Cancelled inventory drag events for all plugin GUIs, so Bedrock/mobile players do not need cursor interaction.

  • Removed dependence on left/right-click behavior.

nyxara19

add a feature that see if a player is in creative mode or in survival mode (compatible with EssentialsX plugin), the placeholder will be %cloudcore_indicator%, make sure that it is compatible with bedrock players (GeyserMC and make sure that it doesnt cause any sort of console spam error or other error that might occur)

Kodari AI
KodariSep 2 at 3:28 am 1
  1. Locate the existing PlaceholderAPI integration and plugin registration.

  2. Add %cloudcore_indicator% with Creative/Survival output and safe fallback behavior.

  3. Verify Geyser/EssentialsX compatibility without introducing hard dependencies or console spam.

Added %cloudcore_indicator% to the existing PlaceholderAPI expansion.

  • Returns Creative for creative-mode players.

  • Returns Survival for survival-mode players.

  • Returns Unknown for offline players or other modes such as Adventure/Spectator.

  • Safely handles null placeholder parameters.

  • Uses Bukkit’s game mode directly, so it works with EssentialsX and does not require any EssentialsX-specific hooks.

  • No Geyser API dependency is needed; Bedrock players are represented as normal Bukkit Player objects through GeyserMC.

  • No console polling, scheduled tasks, or error-prone external calls were added.

nyxara19

add a configurable prefix in indicator.yml for survival and creative prefix placeholder and make the color for survival red and blue for creative

Kodari AI
KodariSep 2 at 4:32 am 1
  1. Extend the existing placeholder to read configurable survival and creative prefixes.

  2. Add indicator.yml with red survival and blue creative defaults.

  3. Load the file safely with fallbacks so missing or malformed settings do not spam the console.

Added configurable indicator prefixes through indicator.yml.

YAML
survival:
  prefix: "&cSurvival"

creative:
  prefix: "&9Creative"

%cloudcore_indicator% now returns:

  • Red Survival by default

  • Blue Creative by default

  • Unknown for offline, Adventure, or Spectator players

The prefixes can be changed in plugins/CloudCore/indicator.yml. Invalid configuration safely falls back to the defaults without console spam.

nyxara19

also add indicator to for god mode either if they are using god mode or not (compatible with EssentialsX, same as feature), the placeholder will be %cloudcore_god_indicator%

Kodari AI
KodariSep 2 at 4:36 am 1

Added %cloudcore_god_indicator%.

  • Uses EssentialsX’s User.isGodModeEnabled() through a safe, optional integration.

  • Default output:

    • &aGod Mode when enabled

    • &cNo God Mode when disabled

    • Unknown if the player is offline

  • Added configurable values in indicator.yml:

YAML
god:
  enabled:
    prefix: "&aGod Mode"
  disabled:
    prefix: "&cNo God Mode"

The feature does not add a hard EssentialsX API call, and reflection failures are safely ignored without console spam.

nyxara19

remake the shop same as economyshopgui plugin and its categories with different .yml, replace the old .yml into new .yml for shop feature only

Kodari AI
KodariSep 2 at 6:43 am 3
  1. Inspect the current shop implementation, GUI click flow, and existing shop configuration.

  2. Replace the shop-only YAML with category-based configuration files and preserve the existing buy-one/buy-stack flow.

  3. Rebuild the shop menus to support category navigation, Bedrock-safe buttons, and safe missing/invalid configuration handling.

The current shop already has category navigation, but it still depends on a hardcoded five-file list and the legacy shop.yml name. I’m replacing that with a discoverable shops.yml index plus shops/<category>.yml files, while keeping the existing Bedrock-safe purchase menu.

The first configuration conversion exposed one cleanup issue: the renamed root file retained legacy entries from the old shop.yml. I’m replacing that file cleanly now so only the new category index remains, with no duplicate or dead shop definitions.

Remade the shop configuration into an EconomyShopGUI-style category system.

  • Replaced shop.yml with shops.yml as the main shop index.

  • Moved category files into:

    • shops/blocks.yml

    • shops/nether.yml

    • shops/redstone.yml

    • shops/food.yml

    • shops/end.yml

  • Categories are now loaded dynamically from shops.yml; no hardcoded category list is used.

  • /shop tab completion now reflects the configured categories.

  • Added configurable menu rows and category back-button slot.

  • Category item menus support up to 6 rows.

  • Preserved the Bedrock-friendly purchase menu with Buy 1, Buy 1 Stack, and Back buttons.

  • Invalid or missing category files are skipped safely with a single warning instead of causing repeated errors.

  • Removed the old root-level shop item fallback configuration.

nyxara19

make the shop same as EconomyShopGUI plugin with its built in category, I want you to add it on shop, also make sure you add different .yml on the categories

Kodari AI
KodariSep 2 at 6:55 am 1
  1. Audit the current shop menu, category loading, and click flow.

  2. Add a built-in category menu with EconomyShopGUI-style navigation.

  3. Split category contents into separate YAML files and keep Bedrock-safe buy controls.

The category GUI and separate category files are already wired in the code, but fresh installations do not copy the category YAML files into plugins/CloudCore/shops/. I’m fixing that deployment gap so the built-in categories actually load reliably.

Updated the shop category setup:

  • Keeps the built-in category menu: Blocks, Nether Items, Redstone, Food, and End Items.

  • Keeps each category in its own YAML file under shops/.

  • Automatically creates the category files on first startup:

    • shops/blocks.yml

    • shops/nether.yml

    • shops/redstone.yml

    • shops/food.yml

    • shops/end.yml

  • Existing files are not overwritten, so server customizations remain safe.

  • Category navigation and the Bedrock-friendly purchase menu remain unchanged.

nyxara19

can you add a feature /cshop <holditem> <category> <amount> <slot> (for admins) that they can add blocks or anything that what player hold and add it on the shop

Kodari AI
KodariSep 2 at 7:02 am 3
  1. Add /cshop holditem <category> <amount> <slot> with an admin permission and category tab completion.

  2. Save the held ItemStack into that category’s YAML, preserving custom item metadata where supported.

  3. Update shop rendering and purchases to use saved items while retaining legacy material-only entries.

Added the admin /cshop feature.

Command

Plain Text
/cshop holditem <category> <amount> <slot>

Example:

Plain Text
/cshop holditem blocks 16 10

This adds the item currently held in the admin’s main hand to the selected shop category and slot.

Features

  • Permission: cloudcore.cshop

  • Defaults to operators

  • Supports blocks and custom items

  • Preserves item metadata such as:

    • Custom names

    • Lore

    • Enchantments

    • Item flags

    • Custom model data

    • Other serialized Bukkit item data

  • Replaces an existing shop item in the same slot

  • Validates amount from 1–64

  • Validates slot from 0–53

  • Saves directly into the category YAML

  • Added /cshop tab completion for holditem and shop categories

  • Custom items can be purchased normally through the existing Buy 1 and Buy 1 Stack menus

The added item’s price defaults to $0. Edit the generated category file under:

Plain Text
plugins/CloudCore/shops/<category>.yml

Set its price value manually after adding it.

nyxara19

I want you that everytime I added something on shop using /cshop, make sure that it will automatically apply the name of the item, the item prices and "click to purchase". I also want to add a feature /cshop remove <category> <item>, make the <item> show at the tab completion those items that are in the category I choose

Kodari AI
KodariSep 2 at 7:21 am 1
  1. Update /cshop holditem so the saved shop entry automatically gets the held item’s display name, a purchase lore line, and a usable default price.

  2. Add /cshop remove <category> <item> with category-specific item tab completion and safe YAML removal.

Updated the shop features:

  • /cshop holditem <category> <amount> <slot>

    • Automatically uses the held item’s custom name, if available.

    • Otherwise generates a readable item name, such as Stone x16.

    • Automatically adds:

      • Price lore

      • Click to purchase

    • Saves the full item, including custom metadata.

    • Uses $1 per item by default.

    • The default price can be changed in shops.yml:

YAML
shop:
  default-price: 1.0
  • Added:

Plain Text
/cshop remove <category> <item>
  • /cshop remove only removes items from the selected category.

  • The item argument now appears in tab completion based on the chosen category.

  • Added remove to /cshop tab completion.

  • Updated the command usage and permission description.

  • Existing category YAML files remain separate and compatible.

nyxara19

I want the shop menu category and the categories of blocks, nether items, redstone, food and end items will be at center to make it clean looking

Kodari AI
KodariSep 2 at 7:23 am 1
  1. Center the main shop category icons in the menu.

  2. Keep Blocks, Nether Items, Redstone, Food, and End Items evenly spaced and preserve existing click behavior.

Centered the shop categories in shops.yml:

  • Blocks: slot 10

  • Nether Items: slot 11

  • Redstone: slot 12

  • Food: slot 13

  • End Items: slot 14

They now appear together across the center row of the 3-row shop menu.

nyxara19

do not keep the blocks, nether items, food, end items, I want you to makeit on tbe center too

Kodari AI
KodariSep 2 at 7:25 am 1

Centering the item entries inside each category menu as well, not just the main category buttons. Each category will use a 3-row layout with its items on the middle row and the back button centered below.

Centered the items inside every shop category menu as well:

  • All category menus now use 3 rows.

  • Items are placed across the center row.

  • The Back to Categories button is centered at slot 22.

  • Updated:

    • Blocks

    • Nether Items

    • Redstone

    • Food

    • End Items

The main category menu remains centered too.

nyxara19

make the rows configurable for blocks, nether, redstone, food and end on its built in .yml

Kodari AI
KodariSep 2 at 7:26 am 1

Rows are already configurable per category in the built-in YAML files. ShopManager reads each category’s rows value and creates the inventory accordingly, limited to 1–6 rows.

Example:

YAML
# shops/blocks.yml
title: '&8Shop &7» &fBlocks'
rows: 4
back-slot: 31

Available files:

Plain Text
shops/blocks.yml
shops/nether.yml
shops/redstone.yml
shops/food.yml
shops/end.yml

Use:

YAML
rows: 1

through:

YAML
rows: 6

The item slot values and back-slot must be adjusted when changing rows. For example, with 4 rows, the center row is slots 9–17, and the centered back button can use slot 31.

nyxara19

remove every x8, x16 to all items on the categories and also make the shop menu category center since its still not on the center

Kodari AI
KodariSep 2 at 7:34 am 1
  1. Remove x8/x16 quantity labels from every item in the category YAML files.

  2. Recenter the main shop category buttons using the actual menu layout and configured slots.

Updated the shop:

  • Removed x8 and x16 from all built-in category item names.

  • New /cshop holditem items no longer automatically receive an amount suffix.

  • Centered the five main shop categories in the middle row:

    • Blocks: slot 11

    • Nether Items: slot 12

    • Redstone: slot 13

    • Food: slot 14

    • End Items: slot 15

nyxara19

also add a level up sound everytime I click on the shop, make sure it works to shop menu category and including the categories same as when everytime you purchase or click the back or close button

Kodari AI
KodariSep 2 at 7:37 am 1

Added the shop sound feature:

  • Plays ENTITY_PLAYER_LEVELUP when clicking:

    • Main shop category buttons

    • Items inside categories

    • Purchase buttons

    • Back buttons

    • Any shop menu slot

  • Plays the same sound when the shop is closed manually.

  • Prevents duplicate sounds when navigating between shop menus.

  • Uses XSeries for cross-version compatibility.

nyxara19

change /cshop holditem <amount> <slot> into /cshop holditem <price> <slot>

Kodari AI
KodariSep 3 at 3:08 am 1
  1. Change holditem argument parsing from item amount to price.

  2. Keep the held item’s actual stack unchanged, save the entered price, and update usage/tab-completion text.

Changed /cshop holditem to use a price instead of an item amount.

New usage

Plain Text
/cshop holditem <category> <price> <slot>

Example:

Plain Text
/cshop holditem blocks 250 10

The command now:

  • Uses the exact amount of the item currently held.

  • Saves the entered price as the item’s total shop price.

  • Keeps the held item’s metadata and stack amount.

  • Calculates the per-item and stack prices in the purchase menu.

  • Requires a price greater than 0.

  • Keeps slot validation from 0–53.

  • Updates the command usage message in plugin.yml.

The amount value is no longer entered in the command.

nyxara19

dont add any lore on the items when you buy it , fix it cuz its annoying when I buy items it has a lore on the items I bought from the shop

Kodari AI
KodariSep 3 at 6:07 am 1

Removed shop lore from purchased items. Items bought through the shop now keep their item metadata but no longer receive the shop price or “Click to purchase” lore.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
31 2,586
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 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("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"));
        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 (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 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; }

    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");
        for (String category : categories.getKeys(false)) {
            String fileName = categories.getString(category + ".file", category.toLowerCase() + ".yml");
            if (fileName == null || !fileName.matches("[A-Za-z0-9_-]+\\.yml")) continue;
            File file = new File(folder, fileName);
            if (!file.isFile()) continue;
            FileConfiguration config = new YamlConfiguration();
            try {
                config.load(file);
                shopCategoryConfigs.put(category.toLowerCase(), config);
                shopCategoryFiles.put(category.toLowerCase(), file);
            } catch (IOException | InvalidConfigurationException ignored) {
                getLogger().warning("Shop category '" + category + "' was skipped because its configuration is invalid.");
            }
        }
    }
}