diff options
| author | Krakenied <Krakenied1@gmail.com> | 2024-04-05 00:03:03 +0200 |
|---|---|---|
| committer | Leonardo Bishop <13875753+LMBishop@users.noreply.github.com> | 2024-04-25 22:06:12 +0100 |
| commit | 275546ebbfc1e221bc845f05b7aae56ca0df81cc (patch) | |
| tree | d969abd835027b9dd2e829eeb8e17a23d09dd31c /bukkit/src/main | |
| parent | f61b8e1c18c4de5b2d222954bb578474d477e3c4 (diff) | |
Add option to disable WildStacker hook
Diffstat (limited to 'bukkit/src/main')
| -rw-r--r-- | bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/MobkillingTaskType.java | 13 | ||||
| -rw-r--r-- | bukkit/src/main/resources/resources/bukkit/config.yml | 5 |
2 files changed, 13 insertions, 5 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/MobkillingTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/MobkillingTaskType.java index 68ec3095..e0d85ba1 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/MobkillingTaskType.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/MobkillingTaskType.java @@ -40,11 +40,14 @@ public final class MobkillingTaskType extends BukkitTaskType { super.addConfigValidator(TaskUtils.useIntegerConfigValidator(this, "data")); super.addConfigValidator(TaskUtils.useBooleanConfigValidator(this, "exact-match")); - try { - Class.forName("com.bgsoftware.wildstacker.api.events.EntityUnstackEvent"); - plugin.getServer().getPluginManager().registerEvents(new MobkillingTaskType.EntityUnstackListener(), plugin); - return; - } catch (ClassNotFoundException ignored) { } // there is no entity unstack available so we use EntityDeathEvent instead + if (plugin.getQuestsConfig().getBoolean("options.mobkilling-use-wildstacker-hook", true)) { + try { + Class.forName("com.bgsoftware.wildstacker.api.events.EntityUnstackEvent"); + plugin.getServer().getPluginManager().registerEvents(new MobkillingTaskType.EntityUnstackListener(), plugin); + return; + } catch (ClassNotFoundException ignored) { + } // there is no entity unstack available so we use EntityDeathEvent instead + } plugin.getServer().getPluginManager().registerEvents(new MobkillingTaskType.EntityDeathListener(), plugin); } diff --git a/bukkit/src/main/resources/resources/bukkit/config.yml b/bukkit/src/main/resources/resources/bukkit/config.yml index 4b26dfc0..fc213c26 100644 --- a/bukkit/src/main/resources/resources/bukkit/config.yml +++ b/bukkit/src/main/resources/resources/bukkit/config.yml @@ -128,6 +128,11 @@ options: # delayed. It may be helpful in case CoreProtect block lookups work sometimes # weird and doesn't account for some last instant/spammed block changes coreprotect-block-lookup-delay: -1 + # If true and WildStacker plugin is present and enabled, Quests will try to set up + # a dedicated WildStacker event handler for mobkilling kills. The dedicated handler + # makes the task type count kills depending on the number of "virtual" merged entities + # killed. Otherwise, vanilla approach will be used. + mobkilling-use-wildstacker-hook: true # Verify quests exist when a player's data is loaded - inconsistencies may arise when # players progress on specific quests and those quests are later removed. The problem is that their progress # is still kept in the quest progress file, which may lead to issues such as players reaching a quest started |
