Mineplex2018-withcommit/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java

99 lines
2.7 KiB
Java
Raw Normal View History

2013-08-27 17:14:08 +02:00
package mineplex.hub;
import me.chiss.Core.MemoryFix.MemoryFix;
import mineplex.core.account.CoreClientManager;
import mineplex.core.command.CommandCenter;
import mineplex.core.creature.Creature;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.enjin.Enjin;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.message.MessageManager;
import mineplex.core.npc.NpcManager;
import mineplex.core.packethandler.PacketHandler;
import mineplex.core.pet.PetManager;
import mineplex.core.portal.Portal;
import mineplex.core.punish.Punish;
import mineplex.core.recharge.Recharge;
import mineplex.core.teleport.Teleport;
import mineplex.core.updater.Updater;
import mineplex.hub.server.ServerManager;
import nautilus.minecraft.core.INautilusPlugin;
import org.bukkit.Server;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
public class Hub extends JavaPlugin implements INautilusPlugin
{
private String WEB_CONFIG = "webServer";
@Override
public void onEnable()
{
getConfig().addDefault(WEB_CONFIG, "http://api.mineplex.com/");
getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG));
saveConfig();
//Core Modules
CoreClientManager clientManager = CoreClientManager.Initialize(this, GetWebServerAddress());
DonationManager donationManager = new DonationManager(this, GetWebServerAddress());
//Static Modules
CommandCenter.Initialize(this, clientManager);
ItemStackFactory.Initialize(this, false);
Recharge.Initialize(this);
//Other Modules
Punish punish = new Punish(this, GetWebServerAddress());
Creature creature = new Creature(this);
new MessageManager(this, clientManager);
new NpcManager(this, creature);
new PetManager(this, clientManager, donationManager, creature, GetWebServerAddress());
//Main Modules
new HubManager(this, clientManager, donationManager);
new Stacker(this);
new Enjin(this, clientManager, donationManager, punish);
new ServerManager(this, clientManager, donationManager, new Portal(this));
new MemoryFix(this);
new DisguiseManager(this, new PacketHandler(this));
new Teleport(this, new Spawn(this));
//Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
}
@Override
public void onDisable()
{
}
@Override
public JavaPlugin GetPlugin()
{
return this;
}
@Override
public String GetWebServerAddress()
{
String webServerAddress = getConfig().getString(WEB_CONFIG);
return webServerAddress;
}
@Override
public Server GetRealServer()
{
return getServer();
}
@Override
public PluginManager GetPluginManager()
{
return GetRealServer().getPluginManager();
}
}