From c2830540c8b51a53a9c200b5d02df9d22e09e650 Mon Sep 17 00:00:00 2001 From: LMBishop <13875753+LMBishop@users.noreply.github.com> Date: Wed, 11 Aug 2021 21:40:59 +0100 Subject: Fix PAPI hook (closes #230) - There is no guarantee that plugins are marked as enabled when using softdepend, moving it to the first tixk probably fixes this --- .../quests/bukkit/BukkitQuestsPlugin.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'bukkit/src/main/java') diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java index eb87b3b4..5a38f4fa 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java @@ -244,18 +244,8 @@ public class BukkitQuestsPlugin extends JavaPlugin implements Quests { this.getQuestsLogger().info("Metrics started. This can be disabled at /plugins/bStats/config.yml."); } - // Setup external plugin hooks - if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) { - this.placeholderAPIHook = new PlaceholderAPIHook(); - this.placeholderAPIHook.registerExpansion(this); - this.placeholderAPIProcessor = (player, s) -> placeholderAPIHook.replacePlaceholders(player, s); - } else { - this.placeholderAPIProcessor = (player, s) -> s; - } - - if (Bukkit.getPluginManager().isPluginEnabled("CoreProtect")) { - this.coreProtectHook = new CoreProtectHook(); - } + // Prepare PAPI processor + this.placeholderAPIProcessor = (player, s) -> s; // Start quests update checker boolean ignoreUpdates = false; @@ -278,6 +268,16 @@ public class BukkitQuestsPlugin extends JavaPlugin implements Quests { // Register task types after the server has fully started Bukkit.getScheduler().runTask(this, () -> { + // Setup external plugin hooks + if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) { + this.placeholderAPIHook = new PlaceholderAPIHook(); + this.placeholderAPIHook.registerExpansion(this); + this.placeholderAPIProcessor = (player, s) -> placeholderAPIHook.replacePlaceholders(player, s); + } + if (Bukkit.getPluginManager().isPluginEnabled("CoreProtect")) { + this.coreProtectHook = new CoreProtectHook(); + } + taskTypeManager.registerTaskType(new MiningTaskType(this)); taskTypeManager.registerTaskType(new MiningCertainTaskType(this)); taskTypeManager.registerTaskType(new BuildingTaskType(this)); -- cgit v1.2.3-70-g09d2