Search in sources :

Example 1 with MainConfig

use of me.totalfreedom.totalfreedommod.config.MainConfig in project TotalFreedomMod by TotalFreedom.

the class TotalFreedomMod method enable.

@Override
public void enable() {
    FLog.info("Created by Madgeek1450 and Prozza");
    FLog.info("Version " + build.formattedVersion());
    FLog.info("Compiled " + build.date + " by " + build.author);
    final MethodTimer timer = new MethodTimer();
    timer.start();
    // Warn if we're running on a wrong version
    ServerInterface.warnVersion();
    // Delete unused files
    FUtil.deleteCoreDumps();
    FUtil.deleteFolder(new File("./_deleteme"));
    // Convert old config files
    new ConfigConverter(plugin).convert();
    BackupManager backups = new BackupManager(this);
    backups.createBackups(TotalFreedomMod.CONFIG_FILENAME, true);
    backups.createBackups(AdminList.CONFIG_FILENAME);
    backups.createBackups(PermbanList.CONFIG_FILENAME);
    config = new MainConfig(this);
    config.load();
    // Start services
    services = new ServiceManager<>(plugin);
    si = services.registerService(ServerInterface.class);
    sf = services.registerService(SavedFlags.class);
    wm = services.registerService(WorldManager.class);
    lv = services.registerService(LogViewer.class);
    al = services.registerService(AdminList.class);
    rm = services.registerService(RankManager.class);
    cl = services.registerService(CommandLoader.class);
    cb = services.registerService(CommandBlocker.class);
    eb = services.registerService(EventBlocker.class);
    bb = services.registerService(BlockBlocker.class);
    mb = services.registerService(MobBlocker.class);
    ib = services.registerService(InteractBlocker.class);
    pb = services.registerService(PotionBlocker.class);
    lp = services.registerService(LoginProcess.class);
    nu = services.registerService(AntiNuke.class);
    as = services.registerService(AntiSpam.class);
    pl = services.registerService(PlayerList.class);
    an = services.registerService(Announcer.class);
    cm = services.registerService(ChatManager.class);
    bm = services.registerService(BanManager.class);
    pm = services.registerService(PermbanList.class);
    pa = services.registerService(ProtectArea.class);
    gr = services.registerService(GameRuleHandler.class);
    // Single admin utils
    rb = services.registerService(RollbackManager.class);
    cs = services.registerService(CommandSpy.class);
    ca = services.registerService(Cager.class);
    fm = services.registerService(Freezer.class);
    or = services.registerService(Orbiter.class);
    mu = services.registerService(Muter.class);
    fo = services.registerService(Fuckoff.class);
    ak = services.registerService(AutoKick.class);
    ae = services.registerService(AutoEject.class);
    mv = services.registerService(MovementValidator.class);
    ew = services.registerService(EntityWiper.class);
    fd = services.registerService(FrontDoor.class);
    sp = services.registerService(ServerPing.class);
    // Fun
    it = services.registerService(ItemFun.class);
    lm = services.registerService(Landminer.class);
    mp = services.registerService(MP44.class);
    jp = services.registerService(Jumppads.class);
    tr = services.registerService(Trailer.class);
    // HTTPD
    hd = services.registerService(HTTPDaemon.class);
    services.start();
    // Start bridges
    bridges = new ServiceManager<>(plugin);
    btb = bridges.registerService(BukkitTelnetBridge.class);
    esb = bridges.registerService(EssentialsBridge.class);
    ldb = bridges.registerService(LibsDisguisesBridge.class);
    web = bridges.registerService(WorldEditBridge.class);
    bridges.start();
    timer.update();
    FLog.info("Version " + pluginVersion + " for " + ServerInterface.COMPILE_NMS_VERSION + " enabled in " + timer.getTotal() + "ms");
    // Metrics @ http://mcstats.org/plugin/TotalFreedomMod
    try {
        final Metrics metrics = new Metrics(plugin);
        metrics.start();
    } catch (IOException ex) {
        FLog.warning("Failed to submit metrics data: " + ex.getMessage());
    }
    // Add spawnpoints later - https://github.com/TotalFreedom/TotalFreedomMod/issues/438
    new BukkitRunnable() {

        @Override
        public void run() {
            plugin.pa.autoAddSpawnpoints();
        }
    }.runTaskLater(plugin, 60L);
}
Also used : BukkitTelnetBridge(me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge) PlayerList(me.totalfreedom.totalfreedommod.player.PlayerList) EventBlocker(me.totalfreedom.totalfreedommod.blocking.EventBlocker) MainConfig(me.totalfreedom.totalfreedommod.config.MainConfig) Trailer(me.totalfreedom.totalfreedommod.fun.Trailer) CommandLoader(me.totalfreedom.totalfreedommod.command.CommandLoader) Metrics(org.mcstats.Metrics) ItemFun(me.totalfreedom.totalfreedommod.fun.ItemFun) PermbanList(me.totalfreedom.totalfreedommod.banning.PermbanList) MobBlocker(me.totalfreedom.totalfreedommod.blocking.MobBlocker) BanManager(me.totalfreedom.totalfreedommod.banning.BanManager) Freezer(me.totalfreedom.totalfreedommod.freeze.Freezer) Jumppads(me.totalfreedom.totalfreedommod.fun.Jumppads) LibsDisguisesBridge(me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge) RollbackManager(me.totalfreedom.totalfreedommod.rollback.RollbackManager) InteractBlocker(me.totalfreedom.totalfreedommod.blocking.InteractBlocker) HTTPDaemon(me.totalfreedom.totalfreedommod.httpd.HTTPDaemon) Landminer(me.totalfreedom.totalfreedommod.fun.Landminer) File(java.io.File) MP44(me.totalfreedom.totalfreedommod.fun.MP44) WorldManager(me.totalfreedom.totalfreedommod.world.WorldManager) Cager(me.totalfreedom.totalfreedommod.caging.Cager) MethodTimer(me.totalfreedom.totalfreedommod.util.MethodTimer) CommandBlocker(me.totalfreedom.totalfreedommod.blocking.command.CommandBlocker) AdminList(me.totalfreedom.totalfreedommod.admin.AdminList) EssentialsBridge(me.totalfreedom.totalfreedommod.bridge.EssentialsBridge) RankManager(me.totalfreedom.totalfreedommod.rank.RankManager) PotionBlocker(me.totalfreedom.totalfreedommod.blocking.PotionBlocker) BukkitRunnable(org.bukkit.scheduler.BukkitRunnable) BlockBlocker(me.totalfreedom.totalfreedommod.blocking.BlockBlocker) IOException(java.io.IOException) WorldEditBridge(me.totalfreedom.totalfreedommod.bridge.WorldEditBridge)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 AdminList (me.totalfreedom.totalfreedommod.admin.AdminList)1 BanManager (me.totalfreedom.totalfreedommod.banning.BanManager)1 PermbanList (me.totalfreedom.totalfreedommod.banning.PermbanList)1 BlockBlocker (me.totalfreedom.totalfreedommod.blocking.BlockBlocker)1 EventBlocker (me.totalfreedom.totalfreedommod.blocking.EventBlocker)1 InteractBlocker (me.totalfreedom.totalfreedommod.blocking.InteractBlocker)1 MobBlocker (me.totalfreedom.totalfreedommod.blocking.MobBlocker)1 PotionBlocker (me.totalfreedom.totalfreedommod.blocking.PotionBlocker)1 CommandBlocker (me.totalfreedom.totalfreedommod.blocking.command.CommandBlocker)1 BukkitTelnetBridge (me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge)1 EssentialsBridge (me.totalfreedom.totalfreedommod.bridge.EssentialsBridge)1 LibsDisguisesBridge (me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge)1 WorldEditBridge (me.totalfreedom.totalfreedommod.bridge.WorldEditBridge)1 Cager (me.totalfreedom.totalfreedommod.caging.Cager)1 CommandLoader (me.totalfreedom.totalfreedommod.command.CommandLoader)1 MainConfig (me.totalfreedom.totalfreedommod.config.MainConfig)1 Freezer (me.totalfreedom.totalfreedommod.freeze.Freezer)1 ItemFun (me.totalfreedom.totalfreedommod.fun.ItemFun)1