diff --git a/src/main/java/com/alttd/playershops/config/MessageConfig.java b/src/main/java/com/alttd/playershops/config/MessageConfig.java index bd0f1f1..6bd014d 100644 --- a/src/main/java/com/alttd/playershops/config/MessageConfig.java +++ b/src/main/java/com/alttd/playershops/config/MessageConfig.java @@ -24,6 +24,7 @@ public class MessageConfig extends AbstractConfiguration { public static String NO_SHOP_CREATE_PERMISSION = "You don't have permission to create shops."; public static String SHOP_LIMIT_REACHED = "You cannot create this shop as you already have reached the limit ()."; public static String BREAK_SHOP_WHILE_CONVERSING = "You can not break shop signs while editing them."; + public static String INSUFFICIENT_FUNDS = "You do not have enough funds to create a shop."; public static String NO_PERMISSION_FOR_SHOP_TYPE = "You do not have permission to use shops."; private static void loadErrorMessages() { @@ -31,6 +32,7 @@ public class MessageConfig extends AbstractConfiguration { NO_SHOP_CREATE_PERMISSION = config.getString("errors.no-shop-create-permission", NO_SHOP_CREATE_PERMISSION); SHOP_LIMIT_REACHED = config.getString("errors.shop-limit-reached", SHOP_LIMIT_REACHED); BREAK_SHOP_WHILE_CONVERSING = config.getString("errors.break-shop-while-conversing", BREAK_SHOP_WHILE_CONVERSING); + INSUFFICIENT_FUNDS = config.getString("errors.insufficient-funds", INSUFFICIENT_FUNDS); NO_PERMISSION_FOR_SHOP_TYPE = config.getString("permissions-messages.shop-type", NO_PERMISSION_FOR_SHOP_TYPE); } diff --git a/src/main/java/com/alttd/playershops/listener/PlayerListener.java b/src/main/java/com/alttd/playershops/listener/PlayerListener.java index 2bad04a..49beab1 100644 --- a/src/main/java/com/alttd/playershops/listener/PlayerListener.java +++ b/src/main/java/com/alttd/playershops/listener/PlayerListener.java @@ -130,6 +130,7 @@ public class PlayerListener extends EventListener { if (!EconomyUtils.hasSufficientFunds(player, Config.shopCreationBalance)) { event.setCancelled(true); + player.sendMiniMessage(MessageConfig.INSUFFICIENT_FUNDS, null); return; }