diff options
| author | Krakenied <Krakenied1@gmail.com> | 2023-03-07 22:57:08 +0100 |
|---|---|---|
| committer | Krakenied <Krakenied1@gmail.com> | 2023-03-07 22:57:08 +0100 |
| commit | e06d3f0e83fcfdd057aa104ca7e8ebe4667450c0 (patch) | |
| tree | 1520f21c3a7203d498290dcaa6a6ba91cd497614 /bukkit/src | |
| parent | 939936696d4f1e2a7f618717d5014c488b184488 (diff) | |
Fix ShopGUIPlus task types
Fixes https://github.com/LMBishop/Quests/issues/496
Diffstat (limited to 'bukkit/src')
2 files changed, 8 insertions, 0 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusBuyTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusBuyTaskType.java index b4e4c80a..ad065851 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusBuyTaskType.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusBuyTaskType.java @@ -52,6 +52,10 @@ public final class ShopGUIPlusBuyTaskType extends BukkitTaskType { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onShopPostTransaction(ShopPostTransactionEvent event) { ShopTransactionResult result = event.getResult(); + if (result.getResult() != ShopTransactionResult.ShopTransactionResultType.SUCCESS) { + return; + } + ShopAction shopAction = result.getShopAction(); if (shopAction != ShopAction.BUY) { return; diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusSellTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusSellTaskType.java index cb1748b9..e07eed98 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusSellTaskType.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/dependent/ShopGUIPlusSellTaskType.java @@ -52,6 +52,10 @@ public final class ShopGUIPlusSellTaskType extends BukkitTaskType { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onShopPostTransaction(ShopPostTransactionEvent event) { ShopTransactionResult result = event.getResult(); + if (result.getResult() != ShopTransactionResult.ShopTransactionResultType.SUCCESS) { + return; + } + ShopAction shopAction = result.getShopAction(); if (shopAction != ShopAction.SELL && shopAction != ShopAction.SELL_ALL) { return; |
