From 684abf34888247998917f796c787c2554defd69e Mon Sep 17 00:00:00 2001 From: AppleDash Date: Wed, 5 Jul 2017 09:59:34 -0400 Subject: [PATCH] Version bump and fix JUnit tests. --- SaneEconomyCore/pom.xml | 4 ++-- .../appledash/saneeconomy/economy/EconomyManager.java | 10 ++++++---- SaneEconomyCore/src/main/resources/plugin.yml | 2 +- SaneEconomyMobKills/pom.xml | 4 ++-- SaneEconomySignShop/pom.xml | 4 ++-- pom.xml | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/SaneEconomyCore/pom.xml b/SaneEconomyCore/pom.xml index d5f1016..3c8a5eb 100644 --- a/SaneEconomyCore/pom.xml +++ b/SaneEconomyCore/pom.xml @@ -6,10 +6,10 @@ org.appledash SaneEconomy - 0.12.1-SNAPSHOT + 0.12.2-SNAPSHOT SaneEconomyCore - 0.12.1-SNAPSHOT + 0.12.2-SNAPSHOT diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/EconomyManager.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/EconomyManager.java index ca7c627..74f8303 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/EconomyManager.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/EconomyManager.java @@ -165,10 +165,12 @@ public class EconomyManager { Economable receiver = transaction.getReceiver(); double amount = transaction.getAmount(); // This amount is validated upon creation of Transaction - SaneEconomyTransactionEvent evt = new SaneEconomyTransactionEvent(transaction); - Bukkit.getServer().getPluginManager().callEvent(evt); - if (evt.isCancelled()) { - return new TransactionResult(transaction, TransactionResult.Status.CANCELLED_BY_PLUGIN); + if (Bukkit.getServer() != null) { // Bukkit.getServer() == null from our JUnit tests. + SaneEconomyTransactionEvent evt = new SaneEconomyTransactionEvent(transaction); + Bukkit.getServer().getPluginManager().callEvent(evt); + if (evt.isCancelled()) { + return new TransactionResult(transaction, TransactionResult.Status.CANCELLED_BY_PLUGIN); + } } if (transaction.isSenderAffected()) { // Sender should have balance taken from them diff --git a/SaneEconomyCore/src/main/resources/plugin.yml b/SaneEconomyCore/src/main/resources/plugin.yml index d35fecd..6e61e13 100644 --- a/SaneEconomyCore/src/main/resources/plugin.yml +++ b/SaneEconomyCore/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: SaneEconomy author: AppleDash main: org.appledash.saneeconomy.SaneEconomy -version: 0.12.1 +version: 0.12.2 load: STARTUP softdepend: [Vault] commands: diff --git a/SaneEconomyMobKills/pom.xml b/SaneEconomyMobKills/pom.xml index 5014cd7..4f774ba 100644 --- a/SaneEconomyMobKills/pom.xml +++ b/SaneEconomyMobKills/pom.xml @@ -5,7 +5,7 @@ SaneEconomy org.appledash - 0.12.1-SNAPSHOT + 0.12.2-SNAPSHOT 4.0.0 @@ -16,7 +16,7 @@ org.appledash SaneEconomyCore - 0.12.1-SNAPSHOT + 0.12.2-SNAPSHOT diff --git a/SaneEconomySignShop/pom.xml b/SaneEconomySignShop/pom.xml index 6f81a83..a9b8571 100644 --- a/SaneEconomySignShop/pom.xml +++ b/SaneEconomySignShop/pom.xml @@ -5,7 +5,7 @@ SaneEconomy org.appledash - 0.12.1-SNAPSHOT + 0.12.2-SNAPSHOT 4.0.0 @@ -16,7 +16,7 @@ org.appledash SaneEconomyCore - 0.12.1-SNAPSHOT + 0.12.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index e73b25a..d33bae7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.appledash SaneEconomy - 0.12.1-SNAPSHOT + 0.12.2-SNAPSHOT pom