From 9bd14b142bc91c0c0030d65630b19c2366b92b43 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 8 Jun 2021 19:31:17 +0100 Subject: [PATCH] Move FAWE detection before guice injection/configuration --- .../plotsquared/bukkit/BukkitPlatform.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java index 2670403ef..8b479fb39 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java @@ -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);