2014-08-20 03:36:23 +02:00
|
|
|
package mineplex.staffServer;
|
|
|
|
|
|
|
|
import mineplex.core.account.CoreClientManager;
|
|
|
|
import mineplex.core.chat.Chat;
|
|
|
|
import mineplex.core.command.CommandCenter;
|
2014-08-21 22:55:09 +02:00
|
|
|
import mineplex.core.creature.Creature;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.donation.DonationManager;
|
2014-08-22 17:47:46 +02:00
|
|
|
import mineplex.core.inventory.InventoryManager;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.memory.MemoryFix;
|
|
|
|
import mineplex.core.monitor.LagMeter;
|
2014-08-21 22:55:09 +02:00
|
|
|
import mineplex.core.npc.NpcManager;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.playerTracker.PlayerTracker;
|
|
|
|
import mineplex.core.portal.Portal;
|
|
|
|
import mineplex.core.preferences.PreferencesManager;
|
2014-08-21 22:55:09 +02:00
|
|
|
import mineplex.core.recharge.Recharge;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.status.ServerStatusManager;
|
|
|
|
import mineplex.core.updater.FileUpdater;
|
2014-08-26 13:56:23 +02:00
|
|
|
import mineplex.core.updater.Updater;
|
2014-08-21 22:55:09 +02:00
|
|
|
import mineplex.staffServer.customerSupport.CustomerSupport;
|
|
|
|
import mineplex.staffServer.password.Password;
|
2014-08-22 17:47:46 +02:00
|
|
|
import mineplex.staffServer.salespackage.SalesPackageManager;
|
2014-08-26 13:56:23 +02:00
|
|
|
import net.minecraft.server.v1_7_R4.MinecraftServer;
|
2014-08-20 03:36:23 +02:00
|
|
|
|
2014-08-26 13:56:23 +02:00
|
|
|
import org.bukkit.Bukkit;
|
2014-08-20 03:36:23 +02:00
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
|
|
|
|
public class StaffServer extends JavaPlugin
|
|
|
|
{
|
|
|
|
private String WEB_CONFIG = "webServer";
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onEnable()
|
|
|
|
{
|
|
|
|
getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/");
|
|
|
|
getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG));
|
|
|
|
saveConfig();
|
|
|
|
|
|
|
|
String webServerAddress = getConfig().getString(WEB_CONFIG);
|
|
|
|
|
|
|
|
//Static Modules
|
|
|
|
CommandCenter.Initialize(this);
|
|
|
|
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress);
|
|
|
|
CommandCenter.Instance.setClientManager(clientManager);
|
2014-08-21 22:55:09 +02:00
|
|
|
Recharge.Initialize(this);
|
2014-08-20 03:36:23 +02:00
|
|
|
|
|
|
|
DonationManager donationManager = new DonationManager(this, webServerAddress);
|
|
|
|
|
2014-08-21 22:55:09 +02:00
|
|
|
new NpcManager(this, new Creature(this));
|
2014-08-20 03:36:23 +02:00
|
|
|
ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager));
|
|
|
|
new PlayerTracker(this, serverStatusManager.getCurrentServerName(), serverStatusManager.getUs());
|
|
|
|
PreferencesManager preferenceManager = new PreferencesManager(this, clientManager, donationManager);
|
|
|
|
preferenceManager.GiveItem = false;
|
|
|
|
|
|
|
|
Portal portal = new Portal(this, serverStatusManager.getCurrentServerName());
|
|
|
|
new Chat(this, clientManager, preferenceManager, serverStatusManager.getCurrentServerName());
|
|
|
|
new MemoryFix(this);
|
|
|
|
new FileUpdater(this, portal);
|
2014-08-26 13:56:23 +02:00
|
|
|
|
2014-08-22 17:47:46 +02:00
|
|
|
new CustomerSupport(this, clientManager, donationManager, new SalesPackageManager(this, clientManager, donationManager, new InventoryManager(this)));
|
2014-08-21 22:55:09 +02:00
|
|
|
new Password(this);
|
2014-08-26 13:56:23 +02:00
|
|
|
|
|
|
|
//Updates
|
|
|
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
|
|
|
|
|
|
|
|
MinecraftServer.getServer().getPropertyManager().setProperty("debug", true);
|
|
|
|
|
|
|
|
Bukkit.getWorlds().get(0).setSpawnLocation(0, 102, 0);
|
2014-08-20 03:36:23 +02:00
|
|
|
}
|
|
|
|
}
|