Files
src
build.gradle
Code
16 1,266
src/main/java/com/abilityshops/AbilityShops.java
package com.abilityshops;
import com.abilityshops.commands.ShopCommand;
import com.abilityshops.listeners.EntityInteractListener;
import com.abilityshops.listeners.InventoryListener;
import com.abilityshops.listeners.ItemUseListener;
import com.abilityshops.managers.AbilityManager;
import com.abilityshops.managers.ConfigManager;
import com.abilityshops.managers.EconomyManager;
import com.abilityshops.managers.ShopManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class AbilityShops extends JavaPlugin {
private ConfigManager configManager;
private ShopManager shopManager;
private AbilityManager abilityManager;
private EconomyManager economyManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.economyManager = new EconomyManager(this);
this.shopManager = new ShopManager(this);
this.abilityManager = new AbilityManager(this);
registerCommands();
registerListeners();
shopManager.loadShops();
getLogger().info("AbilityShops has been enabled!");
}
@Override
public void onDisable() {
if (shopManager != null) {
shopManager.removeAllNPCs();
}
if (abilityManager != null) {
abilityManager.clearCooldowns();
}
getLogger().info("AbilityShops has been disabled!");
}
private void registerCommands() {
getCommand("abilityshop").setExecutor(new ShopCommand(this));
}
private void registerListeners() {
getServer().getPluginManager().registerEvents(new EntityInteractListener(this), this);
getServer().getPluginManager().registerEvents(new InventoryListener(this), this);
getServer().getPluginManager().registerEvents(new ItemUseListener(this), this);
}
}