2014-11-12 14:13:16 +01:00
|
|
|
package mineplex.game.clans;
|
|
|
|
|
|
|
|
import mineplex.core.CustomTagFix;
|
|
|
|
import mineplex.core.account.CoreClientManager;
|
2014-12-03 22:06:50 +01:00
|
|
|
import mineplex.core.achievement.AchievementManager;
|
2014-11-12 14:13:16 +01:00
|
|
|
import mineplex.core.antihack.AntiHack;
|
|
|
|
import mineplex.core.blockrestore.BlockRestore;
|
|
|
|
import mineplex.core.command.CommandCenter;
|
|
|
|
import mineplex.core.cosmetic.CosmeticManager;
|
|
|
|
import mineplex.core.creature.Creature;
|
|
|
|
import mineplex.core.disguise.DisguiseManager;
|
|
|
|
import mineplex.core.donation.DonationManager;
|
2014-12-03 22:06:50 +01:00
|
|
|
import mineplex.core.energy.Energy;
|
2014-11-12 14:13:16 +01:00
|
|
|
import mineplex.core.friend.FriendManager;
|
|
|
|
import mineplex.core.gadget.GadgetManager;
|
|
|
|
import mineplex.core.inventory.InventoryManager;
|
|
|
|
import mineplex.core.itemstack.ItemStackFactory;
|
|
|
|
import mineplex.core.logger.Logger;
|
|
|
|
import mineplex.core.memory.MemoryFix;
|
|
|
|
import mineplex.core.message.MessageManager;
|
|
|
|
import mineplex.core.monitor.LagMeter;
|
|
|
|
import mineplex.core.mount.MountManager;
|
2014-12-03 22:06:50 +01:00
|
|
|
import mineplex.core.movement.Movement;
|
2014-11-12 14:13:16 +01:00
|
|
|
import mineplex.core.npc.NpcManager;
|
|
|
|
import mineplex.core.packethandler.PacketHandler;
|
|
|
|
import mineplex.core.pet.PetManager;
|
|
|
|
import mineplex.core.portal.Portal;
|
|
|
|
import mineplex.core.preferences.PreferencesManager;
|
|
|
|
import mineplex.core.projectile.ProjectileManager;
|
|
|
|
import mineplex.core.punish.Punish;
|
|
|
|
import mineplex.core.recharge.Recharge;
|
|
|
|
import mineplex.core.serverConfig.ServerConfiguration;
|
|
|
|
import mineplex.core.spawn.Spawn;
|
2014-12-03 22:06:50 +01:00
|
|
|
import mineplex.core.stats.StatsManager;
|
2014-11-12 14:13:16 +01:00
|
|
|
import mineplex.core.status.ServerStatusManager;
|
|
|
|
import mineplex.core.teleport.Teleport;
|
|
|
|
import mineplex.core.updater.FileUpdater;
|
|
|
|
import mineplex.core.updater.Updater;
|
2014-11-28 07:34:20 +01:00
|
|
|
import mineplex.game.clans.clans.ClansManager;
|
2014-12-03 22:06:50 +01:00
|
|
|
import mineplex.game.clans.fields.Field;
|
|
|
|
import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
|
|
|
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
|
|
|
|
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
|
|
|
import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
|
|
|
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
|
|
|
|
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
|
2014-11-12 14:13:16 +01:00
|
|
|
import mineplex.minecraft.game.core.combat.CombatManager;
|
2014-11-28 07:34:20 +01:00
|
|
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
2014-11-12 14:13:16 +01:00
|
|
|
import mineplex.minecraft.game.core.damage.DamageManager;
|
2014-12-03 22:06:50 +01:00
|
|
|
import mineplex.minecraft.game.core.fire.Fire;
|
2014-11-12 14:13:16 +01:00
|
|
|
import net.minecraft.server.v1_7_R4.MinecraftServer;
|
|
|
|
|
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
|
|
|
|
public class Clans extends JavaPlugin
|
|
|
|
{
|
|
|
|
private String WEB_CONFIG = "webServer";
|
|
|
|
|
|
|
|
//Modules
|
|
|
|
private CoreClientManager _clientManager;
|
|
|
|
private DonationManager _donationManager;
|
|
|
|
|
|
|
|
private ServerConfiguration _serverConfiguration;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onEnable()
|
|
|
|
{
|
|
|
|
//Configs
|
|
|
|
getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/");
|
|
|
|
getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG));
|
|
|
|
saveConfig();
|
|
|
|
|
|
|
|
String webServerAddress = getConfig().getString(WEB_CONFIG);
|
|
|
|
|
|
|
|
Logger.initialize(this);
|
|
|
|
|
|
|
|
//Static Modules
|
|
|
|
CommandCenter.Initialize(this);
|
|
|
|
_clientManager = new CoreClientManager(this, webServerAddress);
|
|
|
|
CommandCenter.Instance.setClientManager(_clientManager);
|
|
|
|
|
|
|
|
ItemStackFactory.Initialize(this, false);
|
|
|
|
Recharge.Initialize(this);
|
|
|
|
|
|
|
|
_donationManager = new DonationManager(this, webServerAddress);
|
|
|
|
|
|
|
|
_serverConfiguration = new ServerConfiguration(this);
|
|
|
|
|
|
|
|
PreferencesManager preferenceManager = new PreferencesManager(this, _clientManager, _donationManager);
|
|
|
|
new MessageManager(this, _clientManager, preferenceManager);
|
|
|
|
|
|
|
|
ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, _clientManager));
|
2014-11-29 12:16:37 +01:00
|
|
|
new Spawn(this, serverStatusManager.getCurrentServerName());
|
|
|
|
Teleport teleport = new Teleport(this);
|
2014-11-12 14:13:16 +01:00
|
|
|
Portal portal = new Portal(this, serverStatusManager.getCurrentServerName());
|
|
|
|
new FileUpdater(this, portal);
|
|
|
|
|
|
|
|
|
|
|
|
Punish punish = new Punish(this, webServerAddress, _clientManager);
|
|
|
|
AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager);
|
|
|
|
AntiHack.Instance.setKick(false);
|
|
|
|
|
|
|
|
BlockRestore blockRestore = new BlockRestore(this);
|
|
|
|
|
|
|
|
new MemoryFix(this);
|
2014-12-03 22:06:50 +01:00
|
|
|
|
2014-11-12 14:13:16 +01:00
|
|
|
new FriendManager(this, _clientManager, preferenceManager);
|
2014-12-03 22:06:50 +01:00
|
|
|
new InventoryManager(this, _clientManager);
|
2014-11-12 14:13:16 +01:00
|
|
|
|
2014-12-03 22:06:50 +01:00
|
|
|
new ClansManager(this, serverStatusManager.getCurrentServerName(), _clientManager, _donationManager, blockRestore, teleport, webServerAddress);
|
2014-11-28 07:34:20 +01:00
|
|
|
|
2014-11-12 14:13:16 +01:00
|
|
|
//Updates
|
|
|
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
|
|
|
|
|
|
|
|
MinecraftServer.getServer().getPropertyManager().setProperty("debug", true);
|
|
|
|
}
|
|
|
|
}
|