No chat to show

This project's files are all here to explore.

Files
src
build.gradle
Code
32 3,781
src/main/java/com/demonshops/DemonShops.java
package com.demonshops;

import com.demonshops.commands.*;
import com.demonshops.config.ConfigManager;
import com.demonshops.economy.EconomyManager;
import com.demonshops.inventory.gui.GUIListener;
import com.demonshops.inventory.gui.GUIManager;
import com.demonshops.manager.PlayerDataManager;
import com.demonshops.manager.ShopManager;
import com.demonshops.manager.WorthManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class DemonShops extends JavaPlugin {
    
    private ConfigManager configManager;
    private GUIManager guiManager;
    private EconomyManager economyManager;
    private ShopManager shopManager;
    private WorthManager worthManager;
    private PlayerDataManager playerDataManager;
    
    @Override
    public void onEnable() {
        getLogger().info("═══════════════════════════════════════════════════════════");
        getLogger().info("    DemonShops v" + getDescription().getVersion() + " - Loading...");
        getLogger().info("═══════════════════════════════════════════════════════════");
        
        saveDefaultConfig();
        
        configManager = new ConfigManager(this);
        configManager.loadAllConfigs();
        getLogger().info("✓ Configurations loaded successfully");
        
        economyManager = new EconomyManager(this);
        if (!economyManager.hasProvider()) {
            getLogger().warning("⚠ No economy provider found!");
            getLogger().warning("  Install Vault, CoinsEngine, or EssentialsX");
            getLogger().warning("  Shop will not function without economy!");
        } else {
            getLogger().info("✓ Economy provider: " + getConfig().getString("economy-provider", "VAULT"));
        }
        
        shopManager = new ShopManager(this);
        int categories = shopManager.getCategories().size();
        getLogger().info("✓ Loaded " + categories + " shop categories");
        
        worthManager = new WorthManager(this);
        int worthItems = worthManager.getAllWorthItems().size();
        getLogger().info("✓ Loaded " + worthItems + " worth items");
        
        playerDataManager = new PlayerDataManager(this);
        getLogger().info("✓ Player data manager initialized");
        
        guiManager = new GUIManager();
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        getLogger().info("✓ GUI system initialized");
        
        getCommand("shop").setExecutor(new ShopCommand(this));
        DShopCommand dshopCmd = new DShopCommand(this);
        getCommand("dshop").setExecutor(dshopCmd);
        getCommand("dshop").setTabCompleter(dshopCmd);
        
        SellCommand sellCmd = new SellCommand(this);
        getCommand("sell").setExecutor(sellCmd);
        getCommand("sell").setTabCompleter(sellCmd);
        getCommand("sellgui").setExecutor(sellCmd);
        
        WorthCommand worthCmd = new WorthCommand(this);
        getCommand("worth").setExecutor(worthCmd);
        getCommand("worth").setTabCompleter(worthCmd);
        
        SellHistoryCommand sellHistoryCmd = new SellHistoryCommand(this);
        getCommand("sellhistory").setExecutor(sellHistoryCmd);
        getCommand("sellhistory").setTabCompleter(sellHistoryCmd);
        
        DSWCommand dswCmd = new DSWCommand(this);
        getCommand("dsw").setExecutor(dswCmd);
        getCommand("dsw").setTabCompleter(dswCmd);
        
        getLogger().info("✓ Commands registered");
        
        if (Bukkit.getPluginManager().getPlugin("floodgate") != null) {
            getLogger().info("✓ Floodgate detected - Bedrock Edition support enabled!");
        }
        if (Bukkit.getPluginManager().getPlugin("Geyser-Spigot") != null) {
            getLogger().info("✓ Geyser detected - Cross-platform support active!");
        }
        if (Bukkit.getPluginManager().getPlugin("floodgate") != null || 
            Bukkit.getPluginManager().getPlugin("Geyser-Spigot") != null) {
            getLogger().info("  → Java & Bedrock players can use the shop!");
        }
        
        getLogger().info("═══════════════════════════════════════════════════════════");
        getLogger().info("    DemonShops enabled successfully!");
        getLogger().info("    Use /dshop guide for complete documentation");
        getLogger().info("═══════════════════════════════════════════════════════════");
    }
    
    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        getLogger().info("DemonShops has been disabled!");
    }
    
    public void reload() {
        getLogger().info("Reloading DemonShops...");
        reloadConfig();
        configManager.reloadAll();
        getLogger().info("Configurations reloaded");
        shopManager.reload();
        getLogger().info("Shop data reloaded - " + shopManager.getCategories().size() + " categories loaded");
        worthManager.reload();
        getLogger().info("Worth data reloaded - " + worthManager.getAllWorthItems().size() + " items");
        getLogger().info("DemonShops reload complete!");
    }
}