TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java
Video cf5199f28e Squashed commit of the following:
commit 43c68579e5
Merge: 2618d97a b711ed51
Author: elmon <elmon11bussiness@gmail.com>
Date:   Mon Feb 21 10:01:39 2022 +0100

    Merge pull request #190 from AtlasMediaGroup/Elmon11-patch-2

    order of messages fix

commit b711ed517f
Merge: 1c464729 2618d97a
Author: elmon <elmon11bussiness@gmail.com>
Date:   Mon Jan 24 22:16:24 2022 +0100

    Merge branch 'development' into Elmon11-patch-2

commit 2618d97a3e
Author: Nathan Curran <30569566+Focusvity@users.noreply.github.com>
Date:   Mon Jan 24 12:42:47 2022 +1100

    Remove requireNonNull method from getIp, which causes NPE - resolves FS-429 (#187)

    Co-authored-by: Paldiu <pawereus@gmail.com>

commit 1c4647290a
Merge: f00f67a8 850f1210
Author: Nathan Curran <30569566+Focusvity@users.noreply.github.com>
Date:   Mon Jan 24 12:41:47 2022 +1100

    Merge branch 'development' into Elmon11-patch-2

commit f00f67a844
Author: elmon <elmon11bussiness@gmail.com>
Date:   Sun Jan 23 13:26:22 2022 +0100

    order of messages fix

    https://media.discordapp.net/attachments/874713176082636882/934559012991680532/unknown.png

commit 850f12103c
Merge: 2eb0ab4c 7fd77f3c
Author: Paldiu <pawereus@gmail.com>
Date:   Mon Jan 17 11:35:09 2022 -0600

    Merge pull request #188 from AtlasMediaGroup/Wild1145-patch-1

    Correct CoreProtect Version

commit 7fd77f3cbb
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sun Jan 16 18:22:16 2022 +0000

    Correct CoreProtect Version

    To align with the version running on Freedom-01 at the moment.

commit 2eb0ab4cb1
Merge: 8cff0124 2612aaec
Author: Video <videogamesm12@gmail.com>
Date:   Wed Dec 22 20:56:46 2021 -0700

    Merge pull request #179 from AtlasMediaGroup/FS-212

    Makes spawnmob configurable, increases the default limit to 25 (FS-212)

commit 2612aaec31
Author: Video <videogamesm12@gmail.com>
Date:   Wed Dec 15 21:46:56 2021 -0700

    Makes spawnmob configurable and increases the default limit to 25

commit 8cff0124ea
Merge: 35965b0b 1162f10e
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 06:36:20 2021 -0700

    Merge pull request #93 from AtlasMediaGroup/FS-37

    Fixes FS-37

commit 1162f10ebb
Merge: 7ce173e0 35965b0b
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 06:31:18 2021 -0700

    Merge branch 'development' into FS-37

commit 35965b0b10
Merge: aa20a6e5 1253732f
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 06:31:11 2021 -0700

    Merge pull request #174 from AtlasMediaGroup/FS-256

    Forces the server to recalculate the permissions server-wide in /opall (FS-256)

commit 1253732f77
Merge: e1bee321 aa20a6e5
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 06:25:25 2021 -0700

    Merge branch 'development' into FS-256

commit 7ce173e02b
Merge: 4d006ed1 aa20a6e5
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 06:24:34 2021 -0700

    Merge branch 'development' into FS-37

commit aa20a6e579
Merge: 70622900 1ecfb0b0
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 06:23:57 2021 -0700

    Merge pull request #129 from AtlasMediaGroup/FS-7

    Allow players to pay other players coins [FS-7]

commit e1bee32163
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 03:27:07 2021 -0700

    Forces the server to recalculate the permissions server-wide in /opall

commit 4d006ed172
Merge: 8cbfde8b 70622900
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 03:04:42 2021 -0700

    Merge branch 'development' into FS-37

commit 1ecfb0b066
Merge: 225ade87 70622900
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 03:01:22 2021 -0700

    Merge branch 'development' into FS-7

commit 706229004c
Merge: a42cb6af a4adfa9b
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 03:00:15 2021 -0700

    Merge pull request #131 from AtlasMediaGroup/FS-273

    Moves /rainbowtrail to the shop (FS-273)

commit a4adfa9bee
Merge: 1b5bbd1c a42cb6af
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 02:46:41 2021 -0700

    Merge branch 'development' into FS-273

commit 225ade8753
Merge: afe755f5 a42cb6af
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 02:46:02 2021 -0700

    Merge branch 'development' into FS-7

commit 8cbfde8bbc
Merge: bba5ec92 a42cb6af
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 02:41:49 2021 -0700

    Merge branch 'development' into FS-37

commit a42cb6aff9
Merge: 2ecfb886 01fdf766
Author: Video <videogamesm12@gmail.com>
Date:   Mon Nov 29 02:41:34 2021 -0700

    Merge pull request #125 from AtlasMediaGroup/shitcan-savedflags

    Shitcans SavedFlags

commit 01fdf766ee
Merge: 58c21bb1 2ecfb886
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 09:28:48 2021 -0700

    Merge branch 'development' into shitcan-savedflags

commit afe755f5c1
Merge: 5f97e68e 2ecfb886
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 09:26:59 2021 -0700

    Merge branch 'development' into FS-7

commit 5f97e68e0e
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 09:26:49 2021 -0700

    fuck it, it works

commit 1b5bbd1c05
Merge: 8356e831 2ecfb886
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 09:16:21 2021 -0700

    Merge branch 'development' into FS-273

commit 2ecfb88604
Merge: 42143c11 bb2ddf11
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 09:15:16 2021 -0700

    Merge pull request #130 from AtlasMediaGroup/FS-215

    Makes [Discord] a hyperlink (FS-215)

commit 8356e831a5
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 09:11:16 2021 -0700

    Redundancy fix and better protection system

commit ab00cb840f
Merge: ecce62f6 42143c11
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 03:31:45 2021 -0700

    Merge branch 'development' into FS-273

commit bb2ddf1129
Merge: cf9fdc6f 42143c11
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 03:31:19 2021 -0700

    Merge branch 'development' into FS-215

commit bba5ec922b
Merge: 68adaed9 42143c11
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 03:31:13 2021 -0700

    Merge branch 'development' into FS-37

commit 58c21bb1aa
Merge: fdba119d 42143c11
Author: Video <videogamesm12@gmail.com>
Date:   Tue Nov 23 03:30:48 2021 -0700

    Merge branch 'development' into shitcan-savedflags

commit 68adaed997
Merge: 087b8dd7 a598c933
Author: Video <videogamesm12@gmail.com>
Date:   Sat Oct 9 00:09:24 2021 -0600

    Merge branch 'development' into FS-37

commit ecce62f6b4
Merge: d8148530 a598c933
Author: Video <videogamesm12@gmail.com>
Date:   Sat Oct 9 00:01:22 2021 -0600

    Merge branch 'development' into FS-273

commit cf9fdc6fe4
Merge: 387ea6f7 a598c933
Author: Video <videogamesm12@gmail.com>
Date:   Fri Oct 8 01:43:33 2021 -0600

    Merge branch 'development' into FS-215

commit 387ea6f71e
Merge: a1ecf881 180cd811
Author: Video <videogamesm12@gmail.com>
Date:   Fri Oct 1 00:35:12 2021 -0600

    Merge branch 'development' into FS-215

commit d814853036
Merge: 47e63869 213a4338
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sun Sep 12 13:49:05 2021 +0100

    Merge branch 'development' into FS-273

commit a1ecf88109
Merge: bd647afe 213a4338
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sun Sep 12 13:48:59 2021 +0100

    Merge branch 'development' into FS-215

commit 5a6a5ff75d
Merge: 6ca61d9c 213a4338
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sun Sep 12 13:48:50 2021 +0100

    Merge branch 'development' into FS-7

commit fdba119d5d
Merge: 61857dd0 213a4338
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sun Sep 12 13:48:44 2021 +0100

    Merge branch 'development' into shitcan-savedflags

commit 087b8dd7ea
Merge: 3818aab4 213a4338
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sun Sep 12 13:48:21 2021 +0100

    Merge branch 'development' into FS-37

commit 3818aab454
Merge: caeda219 0e12f5e7
Author: Video <videogamesm12@gmail.com>
Date:   Sun Sep 12 03:04:08 2021 -0600

    Merge branch 'development' into FS-37

commit 61857dd06f
Merge: 2d18d461 0e12f5e7
Author: Video <videogamesm12@gmail.com>
Date:   Sun Sep 12 03:01:37 2021 -0600

    Merge branch 'development' into shitcan-savedflags

commit bd647afe92
Merge: 69f17ef2 0e12f5e7
Author: Video <videogamesm12@gmail.com>
Date:   Sun Sep 12 02:50:39 2021 -0600

    Merge branch 'development' into FS-215

commit 69f17ef2d7
Merge: ee1b27fa aebe1ace
Author: Video <videogamesm12@gmail.com>
Date:   Sun Sep 12 02:01:56 2021 -0600

    Merge branch 'development' into FS-215

commit caeda219fa
Merge: 3ca98352 0a9b95bf
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 11 15:26:37 2021 +0100

    Merge branch 'development' into FS-37

commit ee1b27fa0d
Merge: 2bdf14f3 0a9b95bf
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 11 01:24:00 2021 +0100

    Merge branch 'development' into FS-215

commit 6ca61d9c6c
Merge: fedf80b8 0a9b95bf
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 11 01:23:52 2021 +0100

    Merge branch 'development' into FS-7

commit 2d18d461fe
Merge: a4c81f20 0a9b95bf
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 11 01:23:44 2021 +0100

    Merge branch 'development' into shitcan-savedflags

commit 47e6386907
Merge: b1062fbb 0a9b95bf
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 11 01:23:13 2021 +0100

    Merge branch 'development' into FS-273

commit fedf80b834
Merge: a2d11d4b 44ff621d
Author: Video <videogamesm12@gmail.com>
Date:   Fri Sep 10 01:39:16 2021 -0600

    Merge branch 'development' into FS-7

commit 2bdf14f38c
Merge: f6d46b61 44ff621d
Author: Video <videogamesm12@gmail.com>
Date:   Mon Sep 6 15:26:13 2021 -0600

    Merge branch 'development' into FS-215

commit b1062fbb6c
Merge: f69feed4 44ff621d
Author: Video <videogamesm12@gmail.com>
Date:   Mon Sep 6 14:39:32 2021 -0600

    Merge branch 'development' into FS-273

commit 3ca9835257
Merge: da82b270 54cb0cfa
Author: Video <videogamesm12@gmail.com>
Date:   Mon Sep 6 01:16:04 2021 -0600

    Merge branch 'development' into FS-37

commit f69feed469
Author: Video <videogamesm12@gmail.com>
Date:   Mon Sep 6 01:14:21 2021 -0600

    fixed

commit 8253f94ac4
Merge: daf0126f 54cb0cfa
Author: Video <videogamesm12@gmail.com>
Date:   Mon Sep 6 01:12:00 2021 -0600

    Merge branch 'development' into FS-273

commit a4c81f202c
Merge: 0d09c3a5 23caa4e8
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 4 01:23:06 2021 +0100

    Merge branch 'development' into shitcan-savedflags

commit da82b27016
Merge: af1df228 23caa4e8
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 4 01:07:55 2021 +0100

    Merge branch 'development' into FS-37

commit daf0126f45
Merge: a51f5c9b 23caa4e8
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 4 01:07:39 2021 +0100

    Merge branch 'development' into FS-273

commit f6d46b6178
Merge: ee804d52 23caa4e8
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 4 01:07:33 2021 +0100

    Merge branch 'development' into FS-215

commit a2d11d4b93
Merge: dc490659 23caa4e8
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Sep 4 01:07:28 2021 +0100

    Merge branch 'development' into FS-7

commit a51f5c9bbf
Author: Video <videogamesm12@gmail.com>
Date:   Fri Sep 3 13:53:33 2021 -0600

    FS-273

commit ee804d52ff
Author: Video <videogamesm12@gmail.com>
Date:   Fri Sep 3 12:52:15 2021 -0600

    Makes [Discord] a hyperlink (FS-215)

    I've decided to overhaul the implementation of DiscordToMinecraftListener to make it more easily workable. This overhaul allows me to implement FS-215 more easily.

commit dc490659c1
Author: Video <videogamesm12@gmail.com>
Date:   Fri Sep 3 00:07:20 2021 -0600

    Begins implementing FS-7

    should be good enough, but feedback would be lovely

commit 0d09c3a550
Merge: e2ccd14e 4c3f188b
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sun Aug 29 20:09:03 2021 +0100

    Merge branch 'development' into shitcan-savedflags

commit e2ccd14eb3
Author: Video <videogamesm12@gmail.com>
Date:   Fri Aug 27 16:54:55 2021 -0600

    Unsaves SavedFlags

commit af1df22812
Merge: 1474a808 f380898b
Author: Video <videogamesm12@gmail.com>
Date:   Thu Aug 26 23:05:58 2021 -0600

    Merge branch 'development' into FS-37

commit 1474a80875
Merge: 77fd4ff6 f45466ee
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Thu Aug 26 13:26:44 2021 +0100

    Merge branch 'development' into FS-37

commit 77fd4ff66a
Merge: 33aca2a4 d901cbaa
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Sat Aug 21 21:34:04 2021 +0100

    Merge branch 'development' into FS-37

commit 33aca2a482
Merge: 159eda73 0582c2e5
Author: Video <videogamesm12@gmail.com>
Date:   Tue Aug 10 22:38:51 2021 -0600

    Merge branch 'development' into FS-37

commit 159eda73a1
Merge: da2d2525 6874b2ce
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Tue Aug 10 17:34:12 2021 +0100

    Merge branch 'development' into FS-37

commit da2d25252b
Merge: e99aaa2e c8a4382a
Author: Ryan <Wild1145@users.noreply.github.com>
Date:   Tue Aug 10 17:31:13 2021 +0100

    Merge branch 'development' into FS-37

commit e99aaa2eb4
Author: Video <videogamesm12@gmail.com>
Date:   Thu Aug 5 00:32:23 2021 -0600

    Fixes FS-37

    Fixes an oversight introduced in 76bb2d08ac in which the configuration is loaded twice.
2022-02-21 16:45:03 -07:00

378 lines
12 KiB
Java

package me.totalfreedom.totalfreedommod;
import java.io.File;
import java.io.InputStream;
import java.util.Properties;
import me.totalfreedom.totalfreedommod.admin.ActivityLog;
import me.totalfreedom.totalfreedommod.admin.AdminList;
import me.totalfreedom.totalfreedommod.banning.BanManager;
import me.totalfreedom.totalfreedommod.banning.IndefiniteBanList;
import me.totalfreedom.totalfreedommod.blocking.BlockBlocker;
import me.totalfreedom.totalfreedommod.blocking.EditBlocker;
import me.totalfreedom.totalfreedommod.blocking.EventBlocker;
import me.totalfreedom.totalfreedommod.blocking.InteractBlocker;
import me.totalfreedom.totalfreedommod.blocking.MobBlocker;
import me.totalfreedom.totalfreedommod.blocking.PVPBlocker;
import me.totalfreedom.totalfreedommod.blocking.PotionBlocker;
import me.totalfreedom.totalfreedommod.blocking.SignBlocker;
import me.totalfreedom.totalfreedommod.blocking.command.CommandBlocker;
import me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge;
import me.totalfreedom.totalfreedommod.bridge.CoreProtectBridge;
import me.totalfreedom.totalfreedommod.bridge.EssentialsBridge;
import me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge;
import me.totalfreedom.totalfreedommod.bridge.TFGuildsBridge;
import me.totalfreedom.totalfreedommod.bridge.WorldEditBridge;
import me.totalfreedom.totalfreedommod.bridge.WorldGuardBridge;
import me.totalfreedom.totalfreedommod.caging.Cager;
import me.totalfreedom.totalfreedommod.command.CommandLoader;
import me.totalfreedom.totalfreedommod.config.MainConfig;
import me.totalfreedom.totalfreedommod.discord.Discord;
import me.totalfreedom.totalfreedommod.freeze.Freezer;
import me.totalfreedom.totalfreedommod.fun.ItemFun;
import me.totalfreedom.totalfreedommod.fun.Jumppads;
import me.totalfreedom.totalfreedommod.fun.Landminer;
import me.totalfreedom.totalfreedommod.fun.MP44;
import me.totalfreedom.totalfreedommod.fun.Trailer;
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
import me.totalfreedom.totalfreedommod.permissions.PermissionConfig;
import me.totalfreedom.totalfreedommod.permissions.PermissionManager;
import me.totalfreedom.totalfreedommod.player.PlayerList;
import me.totalfreedom.totalfreedommod.punishments.PunishmentList;
import me.totalfreedom.totalfreedommod.rank.RankManager;
import me.totalfreedom.totalfreedommod.shop.Shop;
import me.totalfreedom.totalfreedommod.shop.Votifier;
import me.totalfreedom.totalfreedommod.sql.SQLite;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil;
import me.totalfreedom.totalfreedommod.util.MethodTimer;
import me.totalfreedom.totalfreedommod.world.CleanroomChunkGenerator;
import me.totalfreedom.totalfreedommod.world.WorldManager;
import me.totalfreedom.totalfreedommod.world.WorldRestrictions;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import org.spigotmc.SpigotConfig;
public class TotalFreedomMod extends JavaPlugin
{
public static final String CONFIG_FILENAME = "config.yml";
//
public static final BuildProperties build = new BuildProperties();
//
public static String pluginName;
public static String pluginVersion;
private static TotalFreedomMod plugin;
//
public MainConfig config;
public PermissionConfig permissions;
//
// Service Handler
public FreedomServiceHandler fsh;
// Command Loader
public CommandLoader cl;
// Services
public ServerInterface si;
public WorldManager wm;
public LogViewer lv;
public AdminList al;
public ActivityLog acl;
public RankManager rm;
public CommandBlocker cb;
public EventBlocker eb;
public BlockBlocker bb;
public MobBlocker mb;
public InteractBlocker ib;
public PotionBlocker pb;
public LoginProcess lp;
public AntiNuke nu;
public AntiSpam as;
public PlayerList pl;
public Shop sh;
public Votifier vo;
public SQLite sql;
public Announcer an;
public ChatManager cm;
public Discord dc;
public PunishmentList pul;
public BanManager bm;
public IndefiniteBanList im;
public PermissionManager pem;
public GameRuleHandler gr;
public CommandSpy cs;
public Cager ca;
public Freezer fm;
public EditBlocker ebl;
public PVPBlocker pbl;
public Orbiter or;
public Muter mu;
public Fuckoff fo;
public AutoKick ak;
public AutoEject ae;
public Monitors mo;
public MovementValidator mv;
public ServerPing sp;
public ItemFun it;
public Landminer lm;
public MP44 mp;
public Jumppads jp;
public Trailer tr;
public HTTPDaemon hd;
public WorldRestrictions wr;
public SignBlocker snp;
public EntityWiper ew;
public Sitter st;
public VanishHandler vh;
public Pterodactyl ptero;
//
// Bridges
public BukkitTelnetBridge btb;
public EssentialsBridge esb;
public LibsDisguisesBridge ldb;
public CoreProtectBridge cpb;
public TFGuildsBridge tfg;
public WorldEditBridge web;
public WorldGuardBridge wgb;
public static TotalFreedomMod getPlugin()
{
return plugin;
}
public static TotalFreedomMod plugin()
{
for (Plugin plugin : Bukkit.getPluginManager().getPlugins())
{
if (plugin.getName().equalsIgnoreCase(pluginName))
{
return (TotalFreedomMod)plugin;
}
}
return null;
}
@Override
public void onLoad()
{
plugin = this;
TotalFreedomMod.pluginName = plugin.getDescription().getName();
TotalFreedomMod.pluginVersion = plugin.getDescription().getVersion();
FLog.setPluginLogger(plugin.getLogger());
FLog.setServerLogger(getServer().getLogger());
build.load(plugin);
}
@Override
public void onEnable()
{
FLog.info("Created by Madgeek1450 and Prozza");
FLog.info("Version " + build.version);
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"));
fsh = new FreedomServiceHandler();
config = new MainConfig();
if (FUtil.inDeveloperMode())
{
FLog.debug("Developer mode enabled.");
}
cl = new CommandLoader();
cl.loadCommands();
BackupManager backups = new BackupManager();
backups.createAllBackups();
permissions = new PermissionConfig();
permissions.load();
mv = new MovementValidator();
sp = new ServerPing();
new Initializer();
fsh.startServices();
FLog.info("Started " + fsh.getServiceAmount() + " services.");
timer.update();
FLog.info("Version " + pluginVersion + " for " + ServerInterface.COMPILE_NMS_VERSION + " enabled in " + timer.getTotal() + "ms");
// Metrics @ https://bstats.org/plugin/bukkit/TotalFreedomMod/2966
new Metrics(this, 2966);
// little workaround to stop spigot from autorestarting - causing AMP to detach from process.
SpigotConfig.config.set("settings.restart-on-crash", false);
}
@Override
public void onDisable()
{
// Stop services and bridges
fsh.stopServices();
getServer().getScheduler().cancelTasks(plugin);
FLog.info("Plugin disabled");
}
@Override
public ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id)
{
return new CleanroomChunkGenerator(id);
}
public static class BuildProperties
{
public String author;
public String codename;
public String version;
public String number;
public String date;
public String head;
public void load(TotalFreedomMod plugin)
{
try
{
final Properties props;
try (InputStream in = plugin.getResource("build.properties"))
{
props = new Properties();
props.load(in);
}
author = props.getProperty("buildAuthor", "unknown");
codename = props.getProperty("buildCodeName", "unknown");
version = props.getProperty("buildVersion", pluginVersion);
number = props.getProperty("buildNumber", "1");
date = props.getProperty("buildDate", "unknown");
// Need to do this or it will display ${git.commit.id.abbrev}
head = props.getProperty("buildHead", "unknown").replace("${git.commit.id.abbrev}", "unknown");
}
catch (Exception ex)
{
FLog.severe("Could not load build properties! Did you compile with NetBeans/Maven?");
FLog.severe(ex);
}
}
public String formattedVersion()
{
return pluginVersion + "." + number + " (" + head + ")";
}
}
/**
* This class is provided to please Codacy.
*/
private final class Initializer
{
public Initializer()
{
initServices();
initAdminUtils();
initBridges();
initFun();
initHTTPD();
}
private void initServices()
{
// Start services
si = new ServerInterface();
wm = new WorldManager();
lv = new LogViewer();
sql = new SQLite();
al = new AdminList();
acl = new ActivityLog();
rm = new RankManager();
cb = new CommandBlocker();
eb = new EventBlocker();
bb = new BlockBlocker();
mb = new MobBlocker();
ib = new InteractBlocker();
pb = new PotionBlocker();
lp = new LoginProcess();
nu = new AntiNuke();
as = new AntiSpam();
wr = new WorldRestrictions();
pl = new PlayerList();
sh = new Shop();
vo = new Votifier();
an = new Announcer();
cm = new ChatManager();
dc = new Discord();
pul = new PunishmentList();
bm = new BanManager();
im = new IndefiniteBanList();
pem = new PermissionManager();
gr = new GameRuleHandler();
snp = new SignBlocker();
ew = new EntityWiper();
st = new Sitter();
vh = new VanishHandler();
ptero = new Pterodactyl();
}
private void initAdminUtils()
{
// Single admin utils
cs = new CommandSpy();
ca = new Cager();
fm = new Freezer();
or = new Orbiter();
mu = new Muter();
ebl = new EditBlocker();
pbl = new PVPBlocker();
fo = new Fuckoff();
ak = new AutoKick();
ae = new AutoEject();
mo = new Monitors();
}
private void initBridges()
{
// Start bridges
btb = new BukkitTelnetBridge();
cpb = new CoreProtectBridge();
esb = new EssentialsBridge();
ldb = new LibsDisguisesBridge();
tfg = new TFGuildsBridge();
web = new WorldEditBridge();
wgb = new WorldGuardBridge();
}
private void initFun()
{
// Fun
it = new ItemFun();
lm = new Landminer();
mp = new MP44();
jp = new Jumppads();
tr = new Trailer();
}
private void initHTTPD()
{
// HTTPD
hd = new HTTPDaemon();
}
}
}