Files
src
build.gradle
Code
25 1,459
src/main/java/com/fellashop/FellaShop.java
package com.fellashop;
import com.fellashop.command.FellaShopCommand;
import com.fellashop.command.ShopCommand;
import com.fellashop.economy.EconomyManager;
import com.fellashop.inventory.gui.GUIListener;
import com.fellashop.inventory.gui.GUIManager;
import com.fellashop.manager.AnimationManager;
import com.fellashop.manager.ConfigManager;
import com.fellashop.manager.ShopManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class FellaShop extends JavaPlugin {
private ConfigManager configManager;
private EconomyManager economyManager;
private GUIManager guiManager;
private ShopManager shopManager;
private AnimationManager animationManager;
@Override
public void onEnable() {
this.saveDefaultConfig();
this.configManager = new ConfigManager(this);
this.economyManager = new EconomyManager(this);
if (!this.economyManager.setupEconomy()) {
this.getLogger().severe("Vault not found! Disabling plugin...");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
this.guiManager = new GUIManager();
this.shopManager = new ShopManager(this);
this.animationManager = new AnimationManager(this);
GUIListener guiListener = new GUIListener(this.guiManager);
Bukkit.getPluginManager().registerEvents(guiListener, this);
this.getCommand("shop").setExecutor(new ShopCommand(this));
this.getCommand("fellashop").setExecutor(new FellaShopCommand(this));
this.animationManager.start();
this.getLogger().info("FellaShop has been enabled!");
}
@Override
public void onDisable() {
if (this.animationManager != null) {
this.animationManager.stop();
}
this.getLogger().info("FellaShop has been disabled!");
}
public void reload() {
this.reloadConfig();
this.configManager = new ConfigManager(this);
this.shopManager = new ShopManager(this);
}
public net.milkbowl.vault.economy.Economy getEconomy() {
return this.economyManager.getEconomy();
}
}