diff --git a/src/main/java/de/epiceric/shopchest/config/Config.java b/src/main/java/de/epiceric/shopchest/config/Config.java index c93bd53..f0898a8 100644 --- a/src/main/java/de/epiceric/shopchest/config/Config.java +++ b/src/main/java/de/epiceric/shopchest/config/Config.java @@ -83,6 +83,9 @@ public class Config { /** Whether Towny integration should be enabled **/ public boolean enable_towny_integration; + /** Whether the vendor of the shop should get messages about buys and sells **/ + public boolean enable_vendor_messages; + /** Whether admin shops should be excluded of the shop limits **/ public boolean exclude_admin_shops; @@ -294,6 +297,7 @@ public class Config { enable_debug_log = plugin.getConfig().getBoolean("enable-debug-log"); enable_worldguard_integration = plugin.getConfig().getBoolean("enable-worldguard-integration"); enable_towny_integration = plugin.getConfig().getBoolean("enable-towny-integration"); + enable_vendor_messages = plugin.getConfig().getBoolean("enable-vendor-messages"); explosion_protection = plugin.getConfig().getBoolean("explosion-protection"); exclude_admin_shops = plugin.getConfig().getBoolean("shop-limits.exclude-admin-shops"); append_potion_level_to_item_name = plugin.getConfig().getBoolean("append-potion-level-to-item-name"); diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java index 8db2da3..24ae513 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java @@ -677,7 +677,7 @@ public class ShopInteractListener implements Listener { plugin.debug(executor.getName() + " successfully bought (#" + shop.getID() + ")"); - if (shop.getVendor().isOnline()) { + if (shop.getVendor().isOnline() && config.enable_vendor_messages) { shop.getVendor().getPlayer().sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.SOMEONE_BOUGHT, new LocalizedMessage.ReplacedRegex(Regex.AMOUNT, String.valueOf(newAmount)), new LocalizedMessage.ReplacedRegex(Regex.ITEM_NAME, LanguageUtils.getItemName(product)), new LocalizedMessage.ReplacedRegex(Regex.BUY_PRICE, String.valueOf(newPrice)), new LocalizedMessage.ReplacedRegex(Regex.PLAYER, executor.getName()))); @@ -810,7 +810,7 @@ public class ShopInteractListener implements Listener { plugin.debug(executor.getName() + " successfully sold (#" + shop.getID() + ")"); - if (shop.getVendor().isOnline()) { + if (shop.getVendor().isOnline() && config.enable_vendor_messages) { shop.getVendor().getPlayer().sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.SOMEONE_SOLD, new LocalizedMessage.ReplacedRegex(Regex.AMOUNT, String.valueOf(newAmount)), new LocalizedMessage.ReplacedRegex(Regex.ITEM_NAME, LanguageUtils.getItemName(product)), new LocalizedMessage.ReplacedRegex(Regex.SELL_PRICE, String.valueOf(newPrice)), new LocalizedMessage.ReplacedRegex(Regex.PLAYER, executor.getName()))); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d95e67f..9274481 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -39,6 +39,10 @@ enable-worldguard-integration: true # Of course, this only works if Towny is installed enable-towny-integration: true +# Set whether the vendor of a shop should get messages when players +# buy or sell something from/to his shop +enable-vendor-messages: true + # Set whether the buy- and sell price should be arranged below each other. # The first line will be the buy price with the message "message.hologram.only-buy", # the second line will be the sell price with the message "message.hologram.only-sell".