Files
src
build.gradle
settings.gradle
Code
10 1,170
src/main/java/com/kodari/donutmarketshop/DonutMarketShop.java
package com.kodari.donutmarketshop;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
public final class DonutMarketShop extends JavaPlugin {
@Getter
private Economy economy;
@Getter
private ShopManager shopManager;
@Override
public void onEnable() {
if (!setupEconomy()) {
getLogger().severe("Vault economy was not found. Disabling DonutMarketShop.");
getServer().getPluginManager().disablePlugin(this);
return;
}
saveDefaultConfig();
shopManager = new ShopManager(this);
shopManager.load();
getCommand("shop").setExecutor(new ShopCommand(this));
getServer().getPluginManager().registerEvents(new ShopListener(this), this);
}
private boolean setupEconomy() {
RegisteredServiceProvider<Economy> registration =
getServer().getServicesManager().getRegistration(Economy.class);
if (registration == null) {
return false;
}
economy = registration.getProvider();
return economy != null;
}
}