From d82d368e77df31434762966bcdcd80b481685c7a Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 23 Apr 2022 20:51:24 +0200 Subject: [PATCH] fix messages --- pom.xml | 2 +- .../java/tsp/headdb/inventory/InventoryUtils.java | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index e58aa22..133459a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ tsp.headdb HeadDB - 4.4.0 + 4.4.1 jar diff --git a/src/main/java/tsp/headdb/inventory/InventoryUtils.java b/src/main/java/tsp/headdb/inventory/InventoryUtils.java index 2473a7c..4979fff 100644 --- a/src/main/java/tsp/headdb/inventory/InventoryUtils.java +++ b/src/main/java/tsp/headdb/inventory/InventoryUtils.java @@ -337,15 +337,14 @@ public class InventoryUtils { Utils.sendMessage(player, String.format(localization.getMessage("purchasedHead"), amount, description, cost)); Utils.playSound(player, "paid"); result.accept(true); - return; } }); + } else { + Utils.sendMessage(player, String.format(localization.getMessage("notEnoughMoney"), amount, description)); + Utils.playSound(player, "unavailable"); + result.accept(false); } }); - - Utils.sendMessage(player, String.format(localization.getMessage("notEnoughMoney"), amount, description)); - Utils.playSound(player, "unavailable"); - result.accept(false); return; } @@ -379,12 +378,8 @@ public class InventoryUtils { } private static void runPurchaseCommands() { - // Backwards compatability - if (!config.contains("commands.purchase")) { - return; - } - for (String cmd : config.getStringList("commands.purchase")) { + if (cmd.isEmpty()) continue; Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd); } }