Files
src
build.gradle
Code
22 1,201
src/main/java/com/bitrift/sellsystem/SellSystem.java
package com.bitrift.sellsystem;
import com.bitrift.sellsystem.commands.SellCommand;
import com.bitrift.sellsystem.inventory.gui.GUIListener;
import com.bitrift.sellsystem.inventory.gui.GUIManager;
import com.bitrift.sellsystem.managers.ConfigManager;
import com.bitrift.sellsystem.managers.EconomyManager;
import com.bitrift.sellsystem.managers.HistoryManager;
import com.bitrift.sellsystem.managers.SellManager;
import com.bitrift.sellsystem.managers.WorthManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class SellSystem extends JavaPlugin {
private ConfigManager configManager;
private WorthManager worthManager;
private EconomyManager economyManager;
private SellManager sellManager;
private HistoryManager historyManager;
private GUIManager guiManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.configManager.loadConfigs();
this.worthManager = new WorthManager(this);
this.economyManager = new EconomyManager(this);
this.historyManager = new HistoryManager(this);
this.sellManager = new SellManager(this);
this.guiManager = new GUIManager();
if (this.getCommand("sell") != null) {
this.getCommand("sell").setExecutor(new SellCommand(this));
} else {
this.getLogger().severe("Failed to register /sell command! Check plugin.yml");
this.setEnabled(false);
return;
}
Bukkit.getPluginManager().registerEvents(new GUIListener(this.guiManager), this);
this.getLogger().info("BitRift Sell System enabled!");
if (!this.economyManager.isEnabled()) {
this.getLogger().warning("Vault not found! Using command-based economy.");
}
}
@Override
public void onDisable() {
if (this.historyManager != null) {
this.historyManager.saveAll();
}
this.getLogger().info("BitRift Sell System disabled!");
}
}