Move FAWE detection before guice injection/configuration

This commit is contained in:
dordsor21 2021-06-08 19:31:17 +01:00
parent 4ba1217b84
commit 9bd14b142b

View File

@ -258,6 +258,20 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
final PlotSquared plotSquared = new PlotSquared(this, "Bukkit");
// FAWE
if (Settings.FAWE_Components.FAWE_HOOK) {
Plugin fawe = getServer().getPluginManager().getPlugin("FastAsyncWorldEdit");
if (fawe != null) {
try {
Class.forName("com.boydti.fawe.bukkit.regions.plotsquared.FaweQueueCoordinator");
faweHook = true;
} catch (Exception ignored) {
LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" +
".net/job/FastAsyncWorldEdit-P2-V6/");
}
}
}
// We create the injector after PlotSquared has been initialized, so that we have access
// to generated instances and settings
this.injector = Guice
@ -326,20 +340,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
}
}
// FAWE
if (Settings.FAWE_Components.FAWE_HOOK) {
Plugin fawe = getServer().getPluginManager().getPlugin("FastAsyncWorldEdit");
if (fawe != null) {
try {
Class.forName("com.boydti.fawe.bukkit.regions.plotsquared.FaweQueueCoordinator");
faweHook = true;
} catch (Exception ignored) {
LOGGER.error("Incompatible version of FAWE to enable hook, please upgrade: https://ci.athion" +
".net/job/FastAsyncWorldEdit-P2-V6/");
}
}
}
if (Settings.Enabled_Components.EVENTS) {
getServer().getPluginManager().registerEvents(injector().getInstance(PlayerEventListener.class), this);
getServer().getPluginManager().registerEvents(injector().getInstance(BlockEventListener.class), this);