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;
|
2013-08-28 01:03:04 +02:00
|
|
|
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
|
2013-08-30 10:36:55 +02:00
|
|
|
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);
|
2013-08-28 01:03:04 +02:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|