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

97 lines
2.6 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.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.spawn.Spawn;
2013-08-27 17:14:08 +02:00
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
new Punish(this, GetWebServerAddress());
2013-08-27 17:14:08 +02:00
Creature creature = new Creature(this);
new MessageManager(this, clientManager);
new NpcManager(this, creature);
new PetManager(this, clientManager, donationManager, creature, GetWebServerAddress());
//Main Modules
2013-08-31 11:01:41 +02:00
new HubManager(this, clientManager, donationManager, new DisguiseManager(this, new PacketHandler(this)));
2013-08-27 17:14:08 +02:00
new Stacker(this);
new ServerManager(this, clientManager, donationManager, new Portal(this));
new MemoryFix(this);
new Teleport(this, clientManager, new Spawn(this));
2013-08-27 17:14:08 +02:00
//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();
}
}