From bb4eece790c59d53a56c42c6a5f89cfc08e3ecfb Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Mon, 4 May 2020 22:15:01 +0100 Subject: [PATCH] Fix pre-events not being uncancellable --- .../com/Acrobot/ChestShop/Events/PreShopCreationEvent.java | 6 +++++- .../com/Acrobot/ChestShop/Events/PreTransactionEvent.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Events/PreShopCreationEvent.java b/src/main/java/com/Acrobot/ChestShop/Events/PreShopCreationEvent.java index fbde570..27d6da1 100644 --- a/src/main/java/com/Acrobot/ChestShop/Events/PreShopCreationEvent.java +++ b/src/main/java/com/Acrobot/ChestShop/Events/PreShopCreationEvent.java @@ -47,7 +47,11 @@ public class PreShopCreationEvent extends Event implements Cancellable { */ @Override public void setCancelled(boolean cancel) { - outcome = CreationOutcome.OTHER; + if (cancel) { + outcome = CreationOutcome.OTHER; + } else { + outcome = CreationOutcome.SHOP_CREATED_SUCCESSFULLY; + } } /** diff --git a/src/main/java/com/Acrobot/ChestShop/Events/PreTransactionEvent.java b/src/main/java/com/Acrobot/ChestShop/Events/PreTransactionEvent.java index be2712c..ab68827 100644 --- a/src/main/java/com/Acrobot/ChestShop/Events/PreTransactionEvent.java +++ b/src/main/java/com/Acrobot/ChestShop/Events/PreTransactionEvent.java @@ -217,7 +217,11 @@ public class PreTransactionEvent extends Event implements Cancellable { @Override public void setCancelled(boolean cancel) { - transactionOutcome = OTHER; + if (cancel) { + transactionOutcome = OTHER; + } else { + transactionOutcome = TRANSACTION_SUCCESFUL; + } } /**