Files
src
build.gradle
Code
12 846
src/main/java/com/donutsmp/donutshop/DonutShop.java
package com.donutsmp.donutshop;
import org.bukkit.plugin.java.JavaPlugin;
public class DonutShop extends JavaPlugin {
private ShopConfig shopConfig;
private EconomyManager economyManager;
private ShopGUI shopGUI;
@Override
public void onEnable() {
saveDefaultConfig();
this.shopConfig = new ShopConfig(this);
shopConfig.reload();
try {
this.economyManager = new EconomyManager(this);
} catch (IllegalStateException e) {
getLogger().severe("Vault economy not found! Disabling DonutShop.");
getServer().getPluginManager().disablePlugin(this);
return;
}
this.shopGUI = new ShopGUI(this, shopConfig, economyManager);
ShopCommand executor = new ShopCommand(this);
getCommand("donutshop").setExecutor(executor);
getCommand("donutshopadmin").setExecutor(executor);
getCommand("donutshopadmin").setTabCompleter(executor);
getServer().getPluginManager().registerEvents(shopGUI, this);
getLogger().info("DonutShop v" + getDescription().getVersion() + " enabled!");
}
@Override
public void onDisable() {
getLogger().info("DonutShop disabled.");
}
public void reloadShop() {
shopConfig.reload();
}
public ShopGUI getShopGUI() {
return shopGUI;
}
public EconomyManager getEconomyManager() {
return economyManager;
}
}