2014-08-20 03:36:23 +02:00
|
|
|
package mineplex.staffServer;
|
|
|
|
|
2016-08-23 08:37:05 +02:00
|
|
|
import com.mojang.authlib.GameProfile;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.account.CoreClientManager;
|
2015-06-20 10:43:38 +02:00
|
|
|
import mineplex.core.achievement.AchievementManager;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.chat.Chat;
|
|
|
|
import mineplex.core.command.CommandCenter;
|
2016-07-02 07:20:07 +02:00
|
|
|
import mineplex.core.common.Rank;
|
2014-08-21 22:55:09 +02:00
|
|
|
import mineplex.core.creature.Creature;
|
2016-06-08 01:33:03 +02:00
|
|
|
import mineplex.core.disguise.DisguiseManager;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.donation.DonationManager;
|
2016-04-28 05:12:38 +02:00
|
|
|
import mineplex.core.elo.EloManager;
|
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;
|
2016-06-08 01:33:03 +02:00
|
|
|
import mineplex.core.packethandler.PacketHandler;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.portal.Portal;
|
2016-09-03 21:16:59 +02:00
|
|
|
import mineplex.core.powerplayclub.PowerPlayClubRepository;
|
2014-08-20 03:36:23 +02:00
|
|
|
import mineplex.core.preferences.PreferencesManager;
|
2015-12-11 07:24:59 +01:00
|
|
|
import mineplex.core.profileCache.ProfileCacheManager;
|
2014-11-14 04:14:43 +01:00
|
|
|
import mineplex.core.punish.Punish;
|
2014-08-21 22:55:09 +02:00
|
|
|
import mineplex.core.recharge.Recharge;
|
2014-09-30 21:20:01 +02:00
|
|
|
import mineplex.core.stats.StatsManager;
|
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;
|
2014-08-22 17:47:46 +02:00
|
|
|
import mineplex.staffServer.salespackage.SalesPackageManager;
|
2015-11-10 09:01:39 +01:00
|
|
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
2016-04-28 05:12:38 +02:00
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
2016-10-04 04:06:36 +02:00
|
|
|
import org.spigotmc.SpigotConfig;
|
2016-04-28 05:12:38 +02:00
|
|
|
|
2016-08-23 08:37:05 +02:00
|
|
|
import java.util.UUID;
|
2016-04-28 05:12:38 +02:00
|
|
|
|
2016-06-08 01:33:03 +02:00
|
|
|
import static mineplex.core.Managers.require;
|
|
|
|
|
2014-08-20 03:36:23 +02:00
|
|
|
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);
|
2016-07-02 07:20:07 +02:00
|
|
|
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress, Rank.DEVELOPER);
|
2014-08-20 03:36:23 +02:00
|
|
|
CommandCenter.Instance.setClientManager(clientManager);
|
2014-08-21 22:55:09 +02:00
|
|
|
Recharge.Initialize(this);
|
2014-08-20 03:36:23 +02:00
|
|
|
|
2016-10-28 04:35:27 +02:00
|
|
|
DonationManager donationManager = require(DonationManager.class);
|
2014-08-20 03:36:23 +02:00
|
|
|
|
2015-02-15 00:09:42 +01:00
|
|
|
Punish punish = new Punish(this, webServerAddress, clientManager);
|
2014-08-21 22:55:09 +02:00
|
|
|
new NpcManager(this, new Creature(this));
|
2014-12-14 08:30:39 +01:00
|
|
|
ServerStatusManager serverStatusManager = new ServerStatusManager(this, clientManager, new LagMeter(this, clientManager));
|
2016-08-23 08:37:05 +02:00
|
|
|
PreferencesManager preferenceManager = new PreferencesManager(this, null, clientManager);
|
2014-08-20 03:36:23 +02:00
|
|
|
preferenceManager.GiveItem = false;
|
|
|
|
|
2015-01-11 09:42:31 +01:00
|
|
|
Portal portal = new Portal(this, clientManager, serverStatusManager.getCurrentServerName());
|
2016-04-28 05:12:38 +02:00
|
|
|
EloManager eloManager = new EloManager(this, clientManager);
|
2016-09-03 21:16:59 +02:00
|
|
|
StatsManager statsManager = new StatsManager(this, clientManager);
|
|
|
|
new Chat(this, null, clientManager, preferenceManager, new AchievementManager(statsManager, clientManager, donationManager, null, eloManager), serverStatusManager.getCurrentServerName());
|
2014-08-20 03:36:23 +02:00
|
|
|
new MemoryFix(this);
|
2015-01-23 08:18:38 +01:00
|
|
|
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
2016-06-08 01:33:03 +02:00
|
|
|
|
|
|
|
require(PacketHandler.class);
|
|
|
|
require(DisguiseManager.class);
|
2016-09-03 21:16:59 +02:00
|
|
|
|
2016-10-06 04:57:44 +02:00
|
|
|
PowerPlayClubRepository powerPlayRepo = new PowerPlayClubRepository(this, clientManager, donationManager);
|
2016-09-03 21:16:59 +02:00
|
|
|
new CustomerSupport(this, clientManager, donationManager, new SalesPackageManager(this, clientManager, donationManager, new InventoryManager(this, clientManager), statsManager, powerPlayRepo), powerPlayRepo);
|
2014-12-24 09:41:17 +01:00
|
|
|
//new Password(this, serverStatusManager.getCurrentServerName());
|
2014-08-26 13:56:23 +02:00
|
|
|
|
|
|
|
//Updates
|
|
|
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);
|
|
|
|
|
2016-10-04 04:06:36 +02:00
|
|
|
MinecraftServer.getServer().getPropertyManager().setProperty("debug", false);
|
|
|
|
SpigotConfig.debug = false;
|
2014-08-26 13:56:23 +02:00
|
|
|
|
|
|
|
Bukkit.getWorlds().get(0).setSpawnLocation(0, 102, 0);
|
2014-12-24 09:41:17 +01:00
|
|
|
|
2014-12-24 20:35:34 +01:00
|
|
|
((CraftServer)getServer()).setWhitelist(true);
|
2015-02-21 08:29:19 +01:00
|
|
|
|
2015-03-12 01:23:48 +01:00
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("377bdea3-badc-448d-81c1-65db43b17ea4"), "Strutt20"));
|
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("cf1b629c-cc55-4eb4-be9e-3ca86dfc7b9d"), "mannalou"));
|
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("adaa7613-6683-400f-baf8-7272c04b2cb4"), "Timmy48081_"));
|
2016-07-02 07:20:07 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("231fb752-9556-489b-8428-f47c7598e061"), "Nuclear_Poptart"));
|
2015-07-09 18:07:16 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp"));
|
2015-07-10 22:31:38 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("492ff708-fe76-4c5a-b9ed-a747b5fa20a0"), "Cherdy8s"));
|
2016-07-02 07:20:07 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("6edf17d5-6bb2-4ed9-92e9-bed8e96fff68"), "BlueBeetleHD"));
|
2016-07-22 06:18:34 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("a47a4d04-9f51-44ba-9d35-8de6053e9289"), "AlexTheCoder"));
|
2015-07-10 22:31:38 +02:00
|
|
|
|
2016-09-02 05:01:34 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("cf1b629c-cc55-4eb4-be9e-3ca86dfc7b9d"), "mannalou"));
|
2015-07-09 18:07:16 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("377bdea3-badc-448d-81c1-65db43b17ea4"), "Strutt20"));
|
|
|
|
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp"));
|
2016-07-02 07:20:07 +02:00
|
|
|
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("6edf17d5-6bb2-4ed9-92e9-bed8e96fff68"), "BlueBeetleHD"));
|
2015-12-11 07:24:59 +01:00
|
|
|
|
2016-06-08 01:33:03 +02:00
|
|
|
require(ProfileCacheManager.class);
|
2014-08-20 03:36:23 +02:00
|
|
|
}
|
|
|
|
}
|