Files
src
build.gradle
Code
22 1,465
src/main/java/com/soulshop/SoulShop.java
package com.soulshop;
import com.soulshop.command.SoulCommandExecutor;
import com.soulshop.inventory.gui.GUIListener;
import com.soulshop.inventory.gui.GUIManager;
import com.soulshop.listener.ChatInputListener;
import com.soulshop.listener.VoucherListener;
import com.soulshop.util.ItemUtil;
import com.soulshop.manager.ShopManager;
import com.soulshop.manager.SoulManager;
import com.soulshop.placeholder.SoulPlaceholder;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class SoulShop extends JavaPlugin {
private GUIManager guiManager;
private SoulManager soulManager;
private ShopManager shopManager;
private ChatInputListener chatInputListener;
@Override
public void onEnable() {
saveDefaultConfig();
this.guiManager = new GUIManager();
this.soulManager = new SoulManager(this);
this.shopManager = new ShopManager(this);
this.chatInputListener = new ChatInputListener(this);
soulManager.load();
shopManager.loadCategories();
ItemUtil.initVoucherKey(this);
getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
getServer().getPluginManager().registerEvents(chatInputListener, this);
getServer().getPluginManager().registerEvents(soulManager, this);
getServer().getPluginManager().registerEvents(new VoucherListener(this), this);
if (getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
new SoulPlaceholder(this).register();
}
SoulCommandExecutor executor = new SoulCommandExecutor(this);
getCommand("shop").setExecutor(executor);
getCommand("give").setExecutor(executor);
getCommand("customize").setExecutor(executor);
getCommand("voucher").setExecutor(executor);
}
@Override
public void onDisable() {
soulManager.saveAll();
}
}