2013-08-27 17:14:08 +02:00
|
|
|
package mineplex.hub;
|
|
|
|
|
2015-11-12 23:51:13 +01:00
|
|
|
import org.bukkit.Bukkit;
|
2014-08-18 00:30:35 +02:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
|
2014-09-04 20:33:51 +02:00
|
|
|
import mineplex.core.CustomTagFix;
|
2015-11-12 23:51:13 +01:00
|
|
|
import mineplex.core.PacketsInteractionFix;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.account.CoreClientManager;
|
2014-11-20 07:47:10 +01:00
|
|
|
import mineplex.core.achievement.AchievementManager;
|
2013-10-17 09:37:57 +02:00
|
|
|
import mineplex.core.antihack.AntiHack;
|
2015-04-01 07:56:13 +02:00
|
|
|
import mineplex.core.aprilfools.AprilFoolsManager;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.core.blockrestore.BlockRestore;
|
2013-09-04 20:35:59 +02:00
|
|
|
import mineplex.core.chat.Chat;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.command.CommandCenter;
|
|
|
|
import mineplex.core.creature.Creature;
|
|
|
|
import mineplex.core.disguise.DisguiseManager;
|
|
|
|
import mineplex.core.donation.DonationManager;
|
2014-05-27 11:10:29 +02:00
|
|
|
import mineplex.core.elo.EloManager;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.core.energy.Energy;
|
2014-09-24 10:31:56 +02:00
|
|
|
import mineplex.core.friend.FriendManager;
|
2015-03-16 03:39:33 +01:00
|
|
|
import mineplex.core.give.Give;
|
2015-11-07 03:15:37 +01:00
|
|
|
import mineplex.core.giveaway.GiveawayManager;
|
2015-10-23 21:07:53 +02:00
|
|
|
import mineplex.core.globalpacket.GlobalPacketManager;
|
2014-11-25 22:28:37 +01:00
|
|
|
import mineplex.core.hologram.HologramManager;
|
2015-02-09 14:31:33 +01:00
|
|
|
import mineplex.core.ignore.IgnoreManager;
|
2015-10-16 08:57:19 +02:00
|
|
|
import mineplex.core.inventory.InventoryManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.itemstack.ItemStackFactory;
|
2014-03-09 09:50:13 +01:00
|
|
|
import mineplex.core.memory.MemoryFix;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.message.MessageManager;
|
2013-09-18 00:50:23 +02:00
|
|
|
import mineplex.core.monitor.LagMeter;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.core.movement.Movement;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.npc.NpcManager;
|
|
|
|
import mineplex.core.packethandler.PacketHandler;
|
2015-02-17 03:17:14 +01:00
|
|
|
import mineplex.core.party.PartyManager;
|
2014-12-23 06:49:52 +01:00
|
|
|
import mineplex.core.personalServer.PersonalServerManager;
|
2014-08-07 09:33:24 +02:00
|
|
|
import mineplex.core.pet.PetManager;
|
2015-08-10 10:24:59 +02:00
|
|
|
import mineplex.core.poll.PollManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.portal.Portal;
|
2014-05-30 09:25:48 +02:00
|
|
|
import mineplex.core.preferences.PreferencesManager;
|
2015-12-11 07:24:59 +01:00
|
|
|
import mineplex.core.profileCache.ProfileCacheManager;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.core.projectile.ProjectileManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.punish.Punish;
|
|
|
|
import mineplex.core.recharge.Recharge;
|
2015-12-17 22:03:03 +01:00
|
|
|
import mineplex.core.resourcepack.ResourcePackManager;
|
2014-11-05 23:39:22 +01:00
|
|
|
import mineplex.core.serverConfig.ServerConfiguration;
|
2014-11-20 07:47:10 +01:00
|
|
|
import mineplex.core.stats.StatsManager;
|
2013-09-18 00:50:23 +02:00
|
|
|
import mineplex.core.status.ServerStatusManager;
|
2013-09-03 20:34:28 +02:00
|
|
|
import mineplex.core.task.TaskManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.teleport.Teleport;
|
2015-10-10 04:14:10 +02:00
|
|
|
import mineplex.core.titangiveaway.TitanGiveawayManager;
|
2013-09-01 05:28:35 +02:00
|
|
|
import mineplex.core.updater.FileUpdater;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.updater.Updater;
|
2015-08-02 11:24:34 +02:00
|
|
|
import mineplex.core.velocity.VelocityFix;
|
2015-03-13 01:34:45 +01:00
|
|
|
import mineplex.core.visibility.VisibilityManager;
|
2013-09-27 21:40:09 +02:00
|
|
|
import mineplex.hub.modules.StackerManager;
|
2014-05-27 11:10:29 +02:00
|
|
|
import mineplex.hub.queue.QueueManager;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.hub.server.ServerManager;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
|
|
|
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
|
|
|
|
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
2014-04-25 09:44:14 +02:00
|
|
|
import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
|
|
|
|
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
|
|
|
|
import mineplex.minecraft.game.core.IRelation;
|
|
|
|
import mineplex.minecraft.game.core.combat.CombatManager;
|
2014-09-29 18:14:20 +02:00
|
|
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.minecraft.game.core.damage.DamageManager;
|
|
|
|
import mineplex.minecraft.game.core.fire.Fire;
|
2013-08-27 17:14:08 +02:00
|
|
|
|
2014-07-01 19:23:22 +02:00
|
|
|
public class Hub extends JavaPlugin implements IRelation
|
2013-08-27 17:14:08 +02:00
|
|
|
{
|
|
|
|
private String WEB_CONFIG = "webServer";
|
2015-08-10 10:24:59 +02:00
|
|
|
|
|
|
|
@Override
|
2013-11-21 21:08:58 +01:00
|
|
|
public void onEnable()
|
2014-11-05 23:39:22 +01:00
|
|
|
{
|
2015-11-12 23:51:13 +01:00
|
|
|
Bukkit.setSpawnRadius(0);
|
2014-02-21 22:32:14 +01:00
|
|
|
getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/");
|
2013-08-27 17:14:08 +02:00
|
|
|
getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG));
|
|
|
|
saveConfig();
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2014-07-01 19:23:22 +02:00
|
|
|
String webServerAddress = getConfig().getString(WEB_CONFIG);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-01-23 08:18:38 +01:00
|
|
|
//Logger.initialize(this);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-08-02 11:24:34 +02:00
|
|
|
//Velocity Fix
|
|
|
|
new VelocityFix(this);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Static Modules
|
2014-09-26 08:27:08 +02:00
|
|
|
CommandCenter.Initialize(this);
|
2014-07-01 19:23:22 +02:00
|
|
|
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress);
|
|
|
|
CommandCenter.Instance.setClientManager(clientManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-10-14 04:24:15 +02:00
|
|
|
// new ProfileCacheManager(this);
|
2013-08-27 17:14:08 +02:00
|
|
|
ItemStackFactory.Initialize(this, false);
|
|
|
|
Recharge.Initialize(this);
|
2015-03-17 04:57:17 +01:00
|
|
|
VisibilityManager.Initialize(this); Give.Initialize(this);
|
2014-07-15 07:58:36 +02:00
|
|
|
Punish punish = new Punish(this, webServerAddress, clientManager);
|
2014-12-10 05:38:57 +01:00
|
|
|
BlockRestore blockRestore = new BlockRestore(this);
|
2014-12-29 12:44:00 +01:00
|
|
|
DonationManager donationManager = new DonationManager(this, clientManager, webServerAddress);
|
2014-11-05 23:39:22 +01:00
|
|
|
|
2015-03-02 21:33:04 +01:00
|
|
|
new ServerConfiguration(this, clientManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2014-04-26 11:47:04 +02:00
|
|
|
//Other Modules
|
2014-12-14 08:30:39 +01:00
|
|
|
PacketHandler packetHandler = new PacketHandler(this);
|
|
|
|
DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler);
|
2014-05-30 22:34:55 +02:00
|
|
|
PreferencesManager preferenceManager = new PreferencesManager(this, clientManager, donationManager);
|
|
|
|
preferenceManager.GiveItem = true;
|
2014-07-04 23:23:11 +02:00
|
|
|
Creature creature = new Creature(this);
|
2013-08-31 11:36:31 +02:00
|
|
|
NpcManager npcManager = new NpcManager(this, creature);
|
2015-10-16 08:57:19 +02:00
|
|
|
InventoryManager inventoryManager = new InventoryManager(this, clientManager);
|
|
|
|
PetManager petManager = new PetManager(this, clientManager, donationManager, inventoryManager, disguiseManager, creature, blockRestore, webServerAddress);
|
2014-11-26 19:07:06 +01:00
|
|
|
PollManager pollManager = new PollManager(this, clientManager, donationManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Main Modules
|
2014-12-14 08:30:39 +01:00
|
|
|
ServerStatusManager serverStatusManager = new ServerStatusManager(this, clientManager, new LagMeter(this, clientManager));
|
2015-11-09 09:27:42 +01:00
|
|
|
GiveawayManager giveawayManager = new GiveawayManager(this, clientManager, serverStatusManager);
|
2015-10-10 04:14:10 +02:00
|
|
|
new TitanGiveawayManager(this, clientManager, serverStatusManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-01-11 09:42:31 +01:00
|
|
|
Portal portal = new Portal(this, clientManager, serverStatusManager.getCurrentServerName());
|
2015-02-17 03:17:14 +01:00
|
|
|
|
2014-09-29 18:14:20 +02:00
|
|
|
AntiHack.Initialize(this, punish, portal, preferenceManager, clientManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-02-09 14:31:33 +01:00
|
|
|
IgnoreManager ignoreManager = new IgnoreManager(this, clientManager, preferenceManager, portal);
|
2015-02-11 16:08:06 +01:00
|
|
|
|
2015-08-10 10:24:59 +02:00
|
|
|
FriendManager friendManager = new FriendManager(this, clientManager, preferenceManager, portal);
|
|
|
|
|
2014-11-25 22:25:13 +01:00
|
|
|
StatsManager statsManager = new StatsManager(this, clientManager);
|
2014-11-20 07:47:10 +01:00
|
|
|
AchievementManager achievementManager = new AchievementManager(statsManager, clientManager, donationManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-02-24 01:03:51 +01:00
|
|
|
PartyManager partyManager = new PartyManager(this, portal, clientManager, preferenceManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-11-24 05:23:37 +01:00
|
|
|
SkillConditionManager conditionManager = new SkillConditionManager(this);
|
|
|
|
|
2015-08-09 18:33:44 +02:00
|
|
|
PersonalServerManager personalServerManager = new PersonalServerManager(this, clientManager);
|
2015-11-26 03:49:28 +01:00
|
|
|
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, conditionManager, disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this, packetHandler), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, giveawayManager);
|
2014-08-18 00:30:35 +02:00
|
|
|
|
2014-11-25 22:25:13 +01:00
|
|
|
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this, clientManager), partyManager);
|
2015-04-01 07:56:13 +02:00
|
|
|
|
2014-05-27 11:10:29 +02:00
|
|
|
new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, new StackerManager(hubManager), queueManager);
|
2015-06-20 10:43:38 +02:00
|
|
|
Chat chat = new Chat(this, clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
2015-05-01 06:56:08 +02:00
|
|
|
new MessageManager(this, clientManager, preferenceManager, ignoreManager, punish, friendManager, chat);
|
2015-08-10 10:24:59 +02:00
|
|
|
new MemoryFix(this);
|
2015-01-23 08:18:38 +01:00
|
|
|
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
2014-09-12 22:03:33 +02:00
|
|
|
new CustomTagFix(this, packetHandler);
|
2015-11-12 23:51:13 +01:00
|
|
|
new PacketsInteractionFix(this, packetHandler);
|
2015-12-17 22:03:03 +01:00
|
|
|
new ResourcePackManager(this, portal);
|
2015-11-18 22:47:52 +01:00
|
|
|
new GlobalPacketManager(this, clientManager, serverStatusManager, inventoryManager, donationManager, petManager, statsManager, giveawayManager);
|
2014-10-17 07:41:23 +02:00
|
|
|
//new Replay(this, packetHandler);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-04-01 07:56:13 +02:00
|
|
|
AprilFoolsManager.Initialize(this, clientManager, disguiseManager);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2013-08-31 11:36:31 +02:00
|
|
|
CombatManager combatManager = new CombatManager(this);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2013-08-31 11:36:31 +02:00
|
|
|
ProjectileManager throwManager = new ProjectileManager(this);
|
2015-11-24 05:23:37 +01:00
|
|
|
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2015-05-12 02:55:26 +02:00
|
|
|
DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager, conditionManager);
|
2015-11-24 05:23:37 +01:00
|
|
|
conditionManager.setDamageManager(damage);
|
|
|
|
|
2013-08-31 11:36:31 +02:00
|
|
|
Fire fire = new Fire(this, conditionManager, damage);
|
2015-11-27 11:53:57 +01:00
|
|
|
Teleport teleport = new Teleport(this, clientManager);
|
2014-04-25 09:44:14 +02:00
|
|
|
Energy energy = new Energy(this);
|
2014-08-06 03:07:49 +02:00
|
|
|
energy.setEnabled(false);
|
2015-08-10 10:24:59 +02:00
|
|
|
|
2014-07-01 19:23:22 +02:00
|
|
|
ItemFactory itemFactory = new ItemFactory(this, blockRestore, conditionManager, damage, energy, fire, throwManager, webServerAddress);
|
2014-11-15 09:31:56 +01:00
|
|
|
SkillFactory skillManager = new SkillFactory(this, damage, this, combatManager, conditionManager, throwManager, disguiseManager, blockRestore, fire, new Movement(this), teleport, energy, webServerAddress);
|
2015-11-10 12:17:25 +01:00
|
|
|
ClassManager classManager = new ClassManager(this, clientManager, donationManager, hubManager.GetGadget(), skillManager, itemFactory, webServerAddress);
|
2014-05-07 07:38:27 +02:00
|
|
|
|
2014-11-20 08:01:46 +01:00
|
|
|
ClassShopManager shopManager = new ClassShopManager(this, classManager, skillManager, itemFactory, achievementManager, clientManager);
|
2014-04-26 11:47:04 +02:00
|
|
|
|
2015-11-10 12:17:25 +01:00
|
|
|
new ClassCombatShop(shopManager, clientManager, donationManager, false, "Brute", classManager.GetClass("Brute"), true);
|
|
|
|
new ClassCombatShop(shopManager, clientManager, donationManager, false, "Mage", classManager.GetClass("Mage"), true);
|
|
|
|
new ClassCombatShop(shopManager, clientManager, donationManager, false, "Ranger", classManager.GetClass("Ranger"), true);
|
|
|
|
new ClassCombatShop(shopManager, clientManager, donationManager, false, "Knight", classManager.GetClass("Knight"), true);
|
|
|
|
new ClassCombatShop(shopManager, clientManager, donationManager, false, "Assassin", classManager.GetClass("Assassin"), true);
|
2014-09-24 10:31:56 +02:00
|
|
|
|
2015-12-11 07:24:59 +01:00
|
|
|
new ProfileCacheManager(this);
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//Updates
|
|
|
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onDisable()
|
|
|
|
{
|
2013-11-07 05:25:46 +01:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|
2013-08-31 11:36:31 +02:00
|
|
|
|
|
|
|
@Override
|
2014-12-03 22:06:50 +01:00
|
|
|
public boolean canHurt(Player a, Player b)
|
2013-08-31 11:36:31 +02:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-12-03 22:06:50 +01:00
|
|
|
public boolean canHurt(String a, String b)
|
2013-08-31 11:36:31 +02:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-12-03 22:06:50 +01:00
|
|
|
public boolean isSafe(Player a)
|
2013-08-31 11:36:31 +02:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|