Added message for player not having enough money to make a shop

This commit is contained in:
Teriuihi 2022-09-11 03:36:25 +02:00
parent 439796a7f4
commit 6280373e4a
2 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@ public class MessageConfig extends AbstractConfiguration {
public static String NO_SHOP_CREATE_PERMISSION = "<red>You don't have permission to create shops.</red>"; public static String NO_SHOP_CREATE_PERMISSION = "<red>You don't have permission to create shops.</red>";
public static String SHOP_LIMIT_REACHED = "<red>You cannot create this shop as you already have reached the limit (<limit>).</red>"; public static String SHOP_LIMIT_REACHED = "<red>You cannot create this shop as you already have reached the limit (<limit>).</red>";
public static String BREAK_SHOP_WHILE_CONVERSING = "<red>You can not break shop signs while editing them.</red>"; public static String BREAK_SHOP_WHILE_CONVERSING = "<red>You can not break shop signs while editing them.</red>";
public static String INSUFFICIENT_FUNDS = "<red>You do not have enough funds to create a shop.</red>";
public static String NO_PERMISSION_FOR_SHOP_TYPE = "<red>You do not have permission to use <shop_type> shops."; public static String NO_PERMISSION_FOR_SHOP_TYPE = "<red>You do not have permission to use <shop_type> shops.";
private static void loadErrorMessages() { 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); 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); 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); 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); NO_PERMISSION_FOR_SHOP_TYPE = config.getString("permissions-messages.shop-type", NO_PERMISSION_FOR_SHOP_TYPE);
} }

View File

@ -130,6 +130,7 @@ public class PlayerListener extends EventListener {
if (!EconomyUtils.hasSufficientFunds(player, Config.shopCreationBalance)) { if (!EconomyUtils.hasSufficientFunds(player, Config.shopCreationBalance)) {
event.setCancelled(true); event.setCancelled(true);
player.sendMiniMessage(MessageConfig.INSUFFICIENT_FUNDS, null);
return; return;
} }