// Path: src/main/java/edu/self/startux/craftBay/locale/Color.java
// public final class Color {
//     public static final Color DEFAULT = new Color(new String[]{"DEFAULT", "DFL"}, NamedTextColor.BLUE);
//     public static final Color HEADER = new Color(new String[]{"HEADER", "HEAD", "HD", "H"}, NamedTextColor.YELLOW);
//     public static final Color HIGHLIGHT = new Color(new String[]{"HIGHLIGHT", "HL", "HI"}, NamedTextColor.AQUA);
//     public static final Color SHADOW = new Color(new String[]{"SHADOW", "DARK", "SHADE", "SHD"}, NamedTextColor.DARK_GRAY);
//     public static final Color SHORTCUT = new Color(new String[]{"SHORTCUT", "SC", "S"}, NamedTextColor.WHITE);
//     public static final Color ADMIN = new Color(new String[]{"ADMIN", "ADM"}, NamedTextColor.DARK_RED);
//     public static final Color ADMINHIGHLIGHT = new Color(new String[]{"ADMINHIGHLIGHT", "ADMINHIGH", "ADMINHI", "ADMHL", "ADMHI"}, NamedTextColor.RED);
//     public static final Color ERROR = new Color(new String[]{"ERROR", "ERR"}, NamedTextColor.DARK_RED);
//     public static final Color WARN = new Color(new String[]{"WARNING", "WARN", "WRN"}, NamedTextColor.RED);
//     public static final Color WARNHIGHLIGHT = new Color(new String[]{"WARNINGHIGHLIGHT", "WARNINGHIGH", "WARNHIGH", "WARNHI", "WRNHI"}, NamedTextColor.DARK_RED);
// 
//     private static Map<String, Color> nameMap;
//     private TextColor textColor;
// 
//     private Color(final String[] aliases, final TextColor dfl) {
//         if (nameMap == null) nameMap = new HashMap<String, Color>();
//         for (String alias : aliases) nameMap.put(alias.toLowerCase(), this);
//         this.textColor = dfl;
//     }
// 
//     public static Color getByName(String name) {
//         if (name == null) return null;
//         return nameMap.get(name.toLowerCase());
//     }
// 
//     public void setColor(TextColor color) {
//         this.textColor = color;
//     }
// 
//     @Override
//     public String toString() {
//         return textColor.toString();
//     }
// 
//     public TextColor getTextColor() {
//         return textColor;
//     }
// 
//     public static void configure(ConfigurationSection section) {
//         if (section == null) return;
//         for (String key : section.getKeys(false)) {
//             Color color = getByName(key);
//             if (color == null) {
//                 CraftBayPlugin.getInstance().getLogger().warning("Unknown color key: " + key);
//                 continue;
//             }
//             String value = section.getString(key);
//             TextColor textColor;
//             try {
//                 if (value.startsWith("#")) {
//                     textColor = TextColor.fromHexString(value.substring(1));
//                 } else {
//                     textColor = NamedTextColor.NAMES.value(value);
//                 }
//             } catch (Exception e) {
//                 CraftBayPlugin.getInstance().getLogger().warning("Unknown color value: " + value);
//                 continue;
//             }
//             color.setColor(textColor);
//         }
//     }
// }


import edu.self.startux.craftBay.locale.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.bukkit.Tag;
import org.bukkit.block.ShulkerBox;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;
            data.minbid = minbid;
            data.inventory = inventory;
            data.type = type;
        }
    }

    public void initPlayer(Player player, MoneyAmount minbid) {
        String title = plugin.getMessage("auction.gui.ChestTitle").toString();
        if (title.length() > 32) title = title.substring(0, 32);
        Inventory inventory = Bukkit.createInventory(null, 54, Component.text(title));
        player.openInventory(inventory);
        setPlayer(player, minbid, inventory, Type.CREATE);
    }

    public boolean initPreview(Player player, Auction auction) {
        if (!(auction.getItem() instanceof RealItem)) return false;
        if (playerData.get(player.getUniqueId()) != null) return false;
        RealItem real = (RealItem) auction.getItem();
        ItemStack item = real.getItemStack();
        List<ItemStack> items = new ArrayList<>();
        int amount = real.getAmount().getInt();
        while (amount > 0) {
            int stackSize = Math.min(amount, item.getType().getMaxStackSize());
            amount -= stackSize;
            ItemStack clone = item.clone();
            clone.setAmount(stackSize);
            items.add(clone);
        }
        if (items.isEmpty()) return false;
        int invSize = ((items.size() - 1) / 9 + 1) * 9;
// Path: src/main/java/edu/self/startux/craftBay/locale/Color.java
// public final class Color {
//     public static final Color DEFAULT = new Color(new String[]{"DEFAULT", "DFL"}, NamedTextColor.BLUE);
//     public static final Color HEADER = new Color(new String[]{"HEADER", "HEAD", "HD", "H"}, NamedTextColor.YELLOW);
//     public static final Color HIGHLIGHT = new Color(new String[]{"HIGHLIGHT", "HL", "HI"}, NamedTextColor.AQUA);
//     public static final Color SHADOW = new Color(new String[]{"SHADOW", "DARK", "SHADE", "SHD"}, NamedTextColor.DARK_GRAY);
//     public static final Color SHORTCUT = new Color(new String[]{"SHORTCUT", "SC", "S"}, NamedTextColor.WHITE);
//     public static final Color ADMIN = new Color(new String[]{"ADMIN", "ADM"}, NamedTextColor.DARK_RED);
//     public static final Color ADMINHIGHLIGHT = new Color(new String[]{"ADMINHIGHLIGHT", "ADMINHIGH", "ADMINHI", "ADMHL", "ADMHI"}, NamedTextColor.RED);
//     public static final Color ERROR = new Color(new String[]{"ERROR", "ERR"}, NamedTextColor.DARK_RED);
//     public static final Color WARN = new Color(new String[]{"WARNING", "WARN", "WRN"}, NamedTextColor.RED);
//     public static final Color WARNHIGHLIGHT = new Color(new String[]{"WARNINGHIGHLIGHT", "WARNINGHIGH", "WARNHIGH", "WARNHI", "WRNHI"}, NamedTextColor.DARK_RED);
// 
//     private static Map<String, Color> nameMap;
//     private TextColor textColor;
// 
//     private Color(final String[] aliases, final TextColor dfl) {
//         if (nameMap == null) nameMap = new HashMap<String, Color>();
//         for (String alias : aliases) nameMap.put(alias.toLowerCase(), this);
//         this.textColor = dfl;
//     }
// 
//     public static Color getByName(String name) {
//         if (name == null) return null;
//         return nameMap.get(name.toLowerCase());
//     }
// 
//     public void setColor(TextColor color) {
//         this.textColor = color;
//     }
// 
//     @Override
//     public String toString() {
//         return textColor.toString();
//     }
// 
//     public TextColor getTextColor() {
//         return textColor;
//     }
// 
//     public static void configure(ConfigurationSection section) {
//         if (section == null) return;
//         for (String key : section.getKeys(false)) {
//             Color color = getByName(key);
//             if (color == null) {
//                 CraftBayPlugin.getInstance().getLogger().warning("Unknown color key: " + key);
//                 continue;
//             }
//             String value = section.getString(key);
//             TextColor textColor;
//             try {
//                 if (value.startsWith("#")) {
//                     textColor = TextColor.fromHexString(value.substring(1));
//                 } else {
//                     textColor = NamedTextColor.NAMES.value(value);
//                 }
//             } catch (Exception e) {
//                 CraftBayPlugin.getInstance().getLogger().warning("Unknown color value: " + value);
//                 continue;
//             }
//             color.setColor(textColor);
//         }
//     }
// }


// Path: src/main/java/edu/self/startux/craftBay/AuctionInventory.java
import edu.self.startux.craftBay.locale.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.bukkit.Tag;
import org.bukkit.block.ShulkerBox;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;

            data.minbid = minbid;
            data.inventory = inventory;
            data.type = type;
        }
    }

    public void initPlayer(Player player, MoneyAmount minbid) {
        String title = plugin.getMessage("auction.gui.ChestTitle").toString();
        if (title.length() > 32) title = title.substring(0, 32);
        Inventory inventory = Bukkit.createInventory(null, 54, Component.text(title));
        player.openInventory(inventory);
        setPlayer(player, minbid, inventory, Type.CREATE);
    }

    public boolean initPreview(Player player, Auction auction) {
        if (!(auction.getItem() instanceof RealItem)) return false;
        if (playerData.get(player.getUniqueId()) != null) return false;
        RealItem real = (RealItem) auction.getItem();
        ItemStack item = real.getItemStack();
        List<ItemStack> items = new ArrayList<>();
        int amount = real.getAmount().getInt();
        while (amount > 0) {
            int stackSize = Math.min(amount, item.getType().getMaxStackSize());
            amount -= stackSize;
            ItemStack clone = item.clone();
            clone.setAmount(stackSize);
            items.add(clone);
        }
        if (items.isEmpty()) return false;
        int invSize = ((items.size() - 1) / 9 + 1) * 9;
        Component name = Component.text("Auction Preview", Color.DEFAULT.getTextColor());