2013-08-27 17:14:08 +02:00
|
|
|
package mineplex.hub;
|
|
|
|
|
|
|
|
import me.chiss.Core.MemoryFix.MemoryFix;
|
|
|
|
import mineplex.core.account.CoreClientManager;
|
2013-10-17 09:37:57 +02:00
|
|
|
import mineplex.core.antihack.AntiHack;
|
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;
|
2013-08-31 11:36:31 +02:00
|
|
|
import mineplex.core.energy.Energy;
|
2013-08-27 17:14:08 +02:00
|
|
|
import mineplex.core.itemstack.ItemStackFactory;
|
|
|
|
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;
|
|
|
|
import mineplex.core.pet.PetManager;
|
|
|
|
import mineplex.core.portal.Portal;
|
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;
|
2013-08-28 01:03:04 +02:00
|
|
|
import mineplex.core.spawn.Spawn;
|
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;
|
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;
|
2013-09-27 21:40:09 +02:00
|
|
|
import mineplex.hub.modules.StackerManager;
|
2013-09-09 10:28:35 +02:00
|
|
|
import mineplex.hub.party.PartyManager;
|
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;
|
|
|
|
import mineplex.minecraft.game.classcombat.shop.ClassCombatCustomBuildShop;
|
|
|
|
import mineplex.minecraft.game.classcombat.shop.ClassCombatPurchaseShop;
|
|
|
|
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;
|
2013-10-19 07:52:15 +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
|
|
|
import nautilus.minecraft.core.INautilusPlugin;
|
|
|
|
|
|
|
|
import org.bukkit.Server;
|
2013-08-31 11:36:31 +02:00
|
|
|
import org.bukkit.entity.Player;
|
2013-08-27 17:14:08 +02:00
|
|
|
import org.bukkit.plugin.PluginManager;
|
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
|
2013-08-31 11:36:31 +02:00
|
|
|
public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
|
2013-08-27 17:14:08 +02:00
|
|
|
{
|
|
|
|
private String WEB_CONFIG = "webServer";
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onEnable()
|
|
|
|
{
|
|
|
|
getConfig().addDefault(WEB_CONFIG, "http://api.mineplex.com/");
|
2013-09-23 22:30:40 +02:00
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG));
|
|
|
|
saveConfig();
|
|
|
|
|
|
|
|
//Core Modules
|
2013-09-23 22:30:40 +02:00
|
|
|
CoreClientManager clientManager = CoreClientManager.Initialize(this, GetWebServerAddress());
|
2013-08-27 17:14:08 +02:00
|
|
|
|
|
|
|
//Static Modules
|
|
|
|
CommandCenter.Initialize(this, clientManager);
|
|
|
|
ItemStackFactory.Initialize(this, false);
|
|
|
|
Recharge.Initialize(this);
|
2013-10-17 09:37:57 +02:00
|
|
|
AntiHack.Initialize(this);
|
2013-08-27 17:14:08 +02:00
|
|
|
|
2013-09-18 00:50:23 +02:00
|
|
|
DonationManager donationManager = new DonationManager(this, GetWebServerAddress());
|
|
|
|
|
2013-08-27 17:14:08 +02:00
|
|
|
//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);
|
2013-08-31 11:36:31 +02:00
|
|
|
NpcManager npcManager = new NpcManager(this, creature);
|
2013-08-27 17:14:08 +02:00
|
|
|
new PetManager(this, clientManager, donationManager, creature, GetWebServerAddress());
|
|
|
|
|
|
|
|
//Main Modules
|
2013-10-22 06:46:31 +02:00
|
|
|
PacketHandler packetHandler = new PacketHandler(this);
|
2013-09-02 10:09:28 +02:00
|
|
|
Portal portal = new Portal(this);
|
2013-09-09 10:28:35 +02:00
|
|
|
PartyManager partyManager = new PartyManager(this, clientManager);
|
2013-10-22 06:46:31 +02:00
|
|
|
HubManager hubManager = new HubManager(this, new BlockRestore(this), clientManager, donationManager, new ConditionManager(this), new DisguiseManager(this, packetHandler), new TaskManager(this, GetWebServerAddress()), portal, partyManager);
|
2013-09-27 21:40:09 +02:00
|
|
|
new ServerManager(this, clientManager, donationManager, portal, partyManager, new ServerStatusManager(this, new LagMeter(this, clientManager)), hubManager, new StackerManager(hubManager));
|
2013-09-04 20:35:59 +02:00
|
|
|
new Chat(this, clientManager);
|
2013-08-27 17:14:08 +02:00
|
|
|
new MemoryFix(this);
|
2013-09-02 10:09:28 +02:00
|
|
|
new FileUpdater(this, portal);
|
2013-08-31 11:36:31 +02:00
|
|
|
|
|
|
|
CombatManager combatManager = new CombatManager(this);
|
|
|
|
BlockRestore blockRestore = new BlockRestore(this);
|
|
|
|
ProjectileManager throwManager = new ProjectileManager(this);
|
|
|
|
SkillConditionManager conditionManager = new SkillConditionManager(this);
|
|
|
|
|
|
|
|
DamageManager damage = new DamageManager(this, combatManager, npcManager, new DisguiseManager(this, packetHandler));
|
|
|
|
Fire fire = new Fire(this, conditionManager, damage);
|
|
|
|
Teleport teleport = new Teleport(this, clientManager, new Spawn(this));
|
|
|
|
|
|
|
|
SkillFactory skillManager = new SkillFactory(this, damage, this, combatManager, conditionManager, throwManager, blockRestore, fire, new Movement(this), teleport, new Energy(this), GetWebServerAddress());
|
|
|
|
ClassManager classManager = new ClassManager(this, clientManager, donationManager, skillManager, GetWebServerAddress());
|
|
|
|
|
|
|
|
ClassShopManager shopManager = new ClassShopManager(this, classManager, skillManager, null);
|
|
|
|
new ClassCombatShop(shopManager, clientManager, donationManager, "Select Class Here");
|
2013-10-12 10:55:32 +02:00
|
|
|
new ClassCombatPurchaseShop(shopManager, clientManager, donationManager, "Class Shop");
|
2013-08-31 11:36:31 +02:00
|
|
|
new ClassCombatCustomBuildShop(shopManager, clientManager, donationManager, "Class Setup");
|
2013-10-19 07:52:15 +02:00
|
|
|
|
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();
|
|
|
|
}
|
2013-08-31 11:36:31 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean CanHurt(Player a, Player b)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean CanHurt(String a, String b)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean IsSafe(Player a)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2013-08-27 17:14:08 +02:00
|
|
|
}
|