summaryrefslogtreecommitdiffstats
path: root/bukkit
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2021-08-11 21:40:59 +0100
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2021-08-11 21:40:59 +0100
commitc2830540c8b51a53a9c200b5d02df9d22e09e650 (patch)
tree5f53cbb07712a8cc8bd656c148adae0ad70cb3df /bukkit
parent6c8e1d5c89c7b3eb81b04b8322ac8a8523aa53c7 (diff)
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
Diffstat (limited to 'bukkit')
-rw-r--r--bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java24
1 files changed, 12 insertions, 12 deletions
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));