mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 10:22:29 +00:00
Added vendor information about a sold out shop
This commit is contained in:
parent
f6f8d93b85
commit
4194c72bd4
@ -939,6 +939,7 @@ public class LanguageUtils {
|
||||
messages.add(new LocalizedMessage(LocalizedMessage.Message.NOT_ENOUGH_ITEMS, langConfig.getString("message.not-enough-items", "&cNot enough items.")));
|
||||
messages.add(new LocalizedMessage(LocalizedMessage.Message.VENDOR_NOT_ENOUGH_MONEY, langConfig.getString("message.vendor-not-enough-money", "&cVendor has not enough money.")));
|
||||
messages.add(new LocalizedMessage(LocalizedMessage.Message.OUT_OF_STOCK, langConfig.getString("message.out-of-stock", "&cShop out of stock.")));
|
||||
messages.add(new LocalizedMessage(LocalizedMessage.Message.VENDOR_OUT_OF_STOCK, langConfig.getString("message.vendor-out-of-stock", "&cYour shop that sells &6%AMOUNT% x %ITEMNAME% &cis out of stock."), Regex.AMOUNT, Regex.ITEM_NAME));
|
||||
messages.add(new LocalizedMessage(LocalizedMessage.Message.ERROR_OCCURRED, langConfig.getString("message.error-occurred", "&cAn error occurred: %ERROR%"), Regex.ERROR));
|
||||
messages.add(new LocalizedMessage(LocalizedMessage.Message.AMOUNT_PRICE_NOT_NUMBER, langConfig.getString("message.amount-and-price-not-number", "&cAmount and price must be a number.")));
|
||||
messages.add(new LocalizedMessage(LocalizedMessage.Message.AMOUNT_IS_ZERO, langConfig.getString("message.amount-is-zero", "&cAmount must be greater than 0.")));
|
||||
|
@ -74,6 +74,7 @@ public class LocalizedMessage {
|
||||
NOT_ENOUGH_ITEMS,
|
||||
VENDOR_NOT_ENOUGH_MONEY,
|
||||
OUT_OF_STOCK,
|
||||
VENDOR_OUT_OF_STOCK,
|
||||
ERROR_OCCURRED,
|
||||
AMOUNT_PRICE_NOT_NUMBER,
|
||||
AMOUNT_IS_ZERO,
|
||||
|
@ -284,6 +284,11 @@ public class ShopInteractListener implements Listener {
|
||||
buy(p, shop);
|
||||
} else {
|
||||
p.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.OUT_OF_STOCK));
|
||||
if (shop.getVendor().isOnline() && config.enable_vendor_messages) {
|
||||
shop.getVendor().getPlayer().sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.VENDOR_OUT_OF_STOCK,
|
||||
new LocalizedMessage.ReplacedRegex(Regex.AMOUNT, String.valueOf(shop.getProduct().getAmount())),
|
||||
new LocalizedMessage.ReplacedRegex(Regex.ITEM_NAME, LanguageUtils.getItemName(shop.getProduct()))));
|
||||
}
|
||||
plugin.debug("Shop is out of stock");
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ enable-worldguard-integration: true
|
||||
enable-towny-integration: true
|
||||
|
||||
# Set whether the vendor of a shop should get messages when players
|
||||
# buy or sell something from/to his shop
|
||||
# buy or sell something from/to his shop or if his shop is out of stock
|
||||
enable-vendor-messages: true
|
||||
|
||||
# Set whether the buy- and sell price should be arranged below each other.
|
||||
|
@ -30,6 +30,7 @@ message.not-enough-money=&cNicht genug Geld.
|
||||
message.not-enough-items=&cNicht genug Items.
|
||||
message.vendor-not-enough-money=&cVerkäufer hat nicht genug Geld.
|
||||
message.out-of-stock=&cShop ausverkauft.
|
||||
message.vendor-out-of-stock=&cDein Shop, der &6%AMOUNT% x %ITEMNAME% &cverkauft, ist ausverkauft.
|
||||
message.error-occurred=&cEin Fehler ist aufgetreten: %ERROR%
|
||||
message.amount-and-price-not-number=&cAnzahl und Preise müssen Zahlen sein.
|
||||
message.amount-is-zero=&cAnzahl muss größer als 0 sein.
|
||||
|
@ -111,6 +111,9 @@ message.vendor-not-enough-money=&cVendor has not enough money.
|
||||
# Set the message when the shop is out of stock.
|
||||
message.out-of-stock=&cShop out of stock.
|
||||
|
||||
# Set the message the vendor gets when his shop is out of stock
|
||||
message.vendor-out-of-stock=&cYour shop that sells &6%AMOUNT% x %ITEMNAME% &cis out of stock.
|
||||
|
||||
# Set the message when an error occurred.
|
||||
# Usable regex: %ERROR%
|
||||
message.error-occurred=&cAn error occurred: %ERROR%
|
||||
|
Loading…
Reference in New Issue
Block a user