diff options
| author | Krakenied <Krakenied1@gmail.com> | 2023-03-26 04:31:12 +0200 |
|---|---|---|
| committer | Leonardo Bishop <13875753+LMBishop@users.noreply.github.com> | 2023-04-02 12:20:10 +0100 |
| commit | e45785ceb4a19bcac9f63409e1179696ae0f8688 (patch) | |
| tree | a63f84261b217f52a8caac8ee431864db57e59a0 /bukkit | |
| parent | 042368eb79cef65a7036d08d164cd9ca5e6b069d (diff) | |
Do not register BrewingTaskType for unsupported server versions
Closes https://github.com/LMBishop/Quests/issues/503
Diffstat (limited to 'bukkit')
| -rw-r--r-- | bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java | 5 |
1 files changed, 4 insertions, 1 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 7dc96182..0a0900ef 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/BukkitQuestsPlugin.java @@ -299,7 +299,6 @@ public class BukkitQuestsPlugin extends JavaPlugin implements Quests { taskTypeManager.registerTaskType(new ShearingTaskType(this)); taskTypeManager.registerTaskType(new PositionTaskType(this)); taskTypeManager.registerTaskType(new PlaytimeTaskType(this)); - taskTypeManager.registerTaskType(new BrewingTaskType(this)); taskTypeManager.registerTaskType(new ExpEarnTaskType(this)); taskTypeManager.registerTaskType(new BreedingTaskType(this)); taskTypeManager.registerTaskType(new EnchantingTaskType(this)); @@ -312,6 +311,10 @@ public class BukkitQuestsPlugin extends JavaPlugin implements Quests { taskTypeManager.registerTaskType(new BucketFillTaskType(this)); taskTypeManager.registerTaskType(new InteractTaskType(this)); try { + Class.forName("org.bukkit.event.inventory.BrewEvent").getMethod("getResults"); + taskTypeManager.registerTaskType(new BrewingTaskType(this)); + } catch (ClassNotFoundException | NoSuchMethodException ignored) { } // server version cannot support task type + try { Class.forName("org.bukkit.event.inventory.SmithItemEvent"); taskTypeManager.registerTaskType(new SmithingTaskType(this)); } catch (ClassNotFoundException ignored) { } // server version cannot support task type |
