S
  1. Reduce the size of sell INVENTORY GUI to 5 rows by default.
  2. On shifting slot of button they should work properly in any slot of INVENTORY GUI.
  3. We should be able to customize the slots of fillers in any INVENTORY GUI. By default it will be applied on bottom row of INVENTORY GUI but we should be able to customize it
  4. Every lore, messages, prefix, INVENTORY GUI, material, icon, name and everything should be customisable without no limits.
  5. All functions and everything should be same in both java and bedrock edition
  6. Make every thing like commands, functions, buttons etc. Means every single thing in this plugin work properly without any errors.
  7. Optimize this plugin.
  8. Make the plugin work in any version of java and bedrock or pocket edition same as java edition supporting geysermc and floodgate.

Make everything simple, easy to understand, and customisable without any errors.

Kodari AI
KodariMay 28 at 11:21 am 2

Now let me read the key files to understand the current implementation

Now I have a full picture. Let me plan the changes systematically.

Plan:

  1. InventoryGUI.java — Add dynamic rows support via constructor, getRows(), getContentSlots()

  2. ConfigManager.java — Add getters for rows + filler slots per GUI

  3. SellGUI.java — Rewrite for dynamic rows (default 5), buttons work from ANY slot, configurable filler slots, dynamic content area sizing

  4. WorthGUI.java — Dynamic rows, configurable filler slots, button handling from any slot

  5. SellHistoryGUI.java — Dynamic rows, configurable filler slots

  6. config.yml — Add rows + filler.slots to each GUI section (sell defaults to 5)

  7. Geyser check utility — For bedrock parity, add a simple utility

Let me start.

Task 1: InventoryGUI.java — Add rows support

Kodari can make mistakes. Review important code before using.
Files
src
ADMIN_GUIDE.md
build.gradle
manifest.kod
README.md
Code
33 3,975
src/main/java/com/demon/sellworth/DemonSellWorth.java
package com.demon.sellworth;

import com.demon.sellworth.commands.DswCommand;
import com.demon.sellworth.commands.SellCommand;
import com.demon.sellworth.commands.SellGuiCommand;
import com.demon.sellworth.commands.SellHistoryCommand;
import com.demon.sellworth.commands.WorthCommand;
import com.demon.sellworth.config.ConfigManager;
import com.demon.sellworth.config.MessageManager;
import com.demon.sellworth.inventory.gui.GUIListener;
import com.demon.sellworth.inventory.gui.GUIManager;
import com.demon.sellworth.listeners.PlayerConnectionListener;
import com.demon.sellworth.managers.EconomyManager;
import com.demon.sellworth.managers.InventoryWorthDisplayManager;
import com.demon.sellworth.managers.PlayerDataManager;
import com.demon.sellworth.managers.WorthManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class DemonSellWorth extends JavaPlugin {

    private static DemonSellWorth instance;

    private ConfigManager configManager;
    private MessageManager messageManager;
    private WorthManager worthManager;
    private EconomyManager economyManager;
    private PlayerDataManager playerDataManager;
    private GUIManager guiManager;
    private InventoryWorthDisplayManager inventoryWorthDisplayManager;

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

        saveDefaultConfig();

        configManager = new ConfigManager(this);
        messageManager = new MessageManager(this);
        worthManager = new WorthManager(this);
        economyManager = new EconomyManager(this);
        playerDataManager = new PlayerDataManager(this);
        guiManager = new GUIManager();

        if (!economyManager.setup()) {
            getLogger().severe("No economy provider found! Disabling plugin.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        GUIListener guiListener = new GUIListener(guiManager);
        getServer().getPluginManager().registerEvents(guiListener, this);

        PlayerConnectionListener connectionListener = new PlayerConnectionListener(this);
        getServer().getPluginManager().registerEvents(connectionListener, this);

        inventoryWorthDisplayManager = new InventoryWorthDisplayManager(this);
        inventoryWorthDisplayManager.start();

        registerCommands();

        getLogger().info("DemonSellWorth enabled successfully!");
    }

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

    private void registerCommands() {
        getCommand("sell").setExecutor(new SellCommand(this));
        getCommand("sellgui").setExecutor(new SellGuiCommand(this));
        getCommand("worth").setExecutor(new WorthCommand(this));
        getCommand("sellhistory").setExecutor(new SellHistoryCommand(this));
        getCommand("dsw").setExecutor(new DswCommand(this));
    }

    public static DemonSellWorth getInstance() {
        return instance;
    }

    public void reload() {
        reloadConfig();
        configManager.reload();
        messageManager.reload();
        worthManager.reload();
        if (inventoryWorthDisplayManager != null) {
            inventoryWorthDisplayManager.reload();
        }
    }
}