Added message for player not having enough money to make a shop
This commit is contained in:
parent
439796a7f4
commit
6280373e4a
|
|
@ -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 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 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.";
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user