Files
src
pom.xml
Code
18 1,259
src/main/java/com/kodari/blacksmith/BlacksmithPlugin.java
package com.kodari.blacksmith;
import com.kodari.blacksmith.command.BlacksmithCommand;
import com.kodari.blacksmith.config.BlacksmithConfig;
import com.kodari.blacksmith.economy.CurrencyService;
import com.kodari.blacksmith.gui.GUIListener;
import com.kodari.blacksmith.gui.GUIManager;
import com.kodari.blacksmith.integration.CitizensListener;
import com.kodari.blacksmith.integration.FloodgatePolicy;
import com.kodari.blacksmith.integration.MMOItemsBridge;
import com.kodari.blacksmith.service.ForgeService;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class BlacksmithPlugin extends JavaPlugin {
private BlacksmithConfig blacksmithConfig;
private GUIManager guiManager;
private ForgeService forgeService;
private MMOItemsBridge mmoItemsBridge;
private FloodgatePolicy floodgatePolicy;
@Override
public void onEnable() {
saveDefaultConfig();
blacksmithConfig = new BlacksmithConfig(this);
mmoItemsBridge = new MMOItemsBridge(this, blacksmithConfig);
CurrencyService currencyService = new CurrencyService(this, blacksmithConfig);
forgeService = new ForgeService(this, blacksmithConfig, mmoItemsBridge, currencyService);
floodgatePolicy = new FloodgatePolicy(this, blacksmithConfig);
guiManager = new GUIManager();
Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
BlacksmithCommand command = new BlacksmithCommand(this);
if (getCommand("blacksmith") != null) {
getCommand("blacksmith").setExecutor(command);
getCommand("blacksmith").setTabCompleter(command);
}
if (Bukkit.getPluginManager().getPlugin("Citizens") != null) {
Bukkit.getPluginManager().registerEvents(new CitizensListener(this), this);
}
}
public void reloadBlacksmith() {
reloadConfig();
blacksmithConfig = new BlacksmithConfig(this);
mmoItemsBridge = new MMOItemsBridge(this, blacksmithConfig);
forgeService = new ForgeService(this, blacksmithConfig, mmoItemsBridge,
new CurrencyService(this, blacksmithConfig));
floodgatePolicy = new FloodgatePolicy(this, blacksmithConfig);
}
public BlacksmithConfig getBlacksmithConfig() {
return blacksmithConfig;
}
public GUIManager getGuiManager() {
return guiManager;
}
public ForgeService getForgeService() {
return forgeService;
}
public MMOItemsBridge getMmoItemsBridge() {
return mmoItemsBridge;
}
public FloodgatePolicy getFloodgatePolicy() {
return floodgatePolicy;
}
}