diff --git a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java index 689b036..5f00e07 100644 --- a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java +++ b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java @@ -997,7 +997,8 @@ public class LanguageUtils { generationNames.add(new BookGenerationName(CustomBookMeta.Generation.TATTERED, langConfig.getString("book.generation.3", "Tattered"))); // Add ShopChest Messages - messages.add(new LocalizedMessage(LocalizedMessage.Message.SHOP_CREATED, langConfig.getString("message.shop-created", "&6Shop created."))); + messages.add(new LocalizedMessage(LocalizedMessage.Message.SHOP_CREATED, langConfig.getString("message.shop-created", "&6You were withdrawn &c%CREATION-PRICE% &6to create this shop."), Placeholder.CREATION_PRICE)); + messages.add(new LocalizedMessage(LocalizedMessage.Message.ADMIN_SHOP_CREATED, langConfig.getString("message.admin-shop-created", "&6You were withdrawn &c%CREATION-PRICE% &6to create this admin shop."), Placeholder.CREATION_PRICE)); messages.add(new LocalizedMessage(LocalizedMessage.Message.CHEST_ALREADY_SHOP, langConfig.getString("message.chest-already-shop", "&cChest already shop."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.CHEST_BLOCKED, langConfig.getString("message.chest-blocked", "&cThere must not be a block above the chest."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.DOUBLE_CHEST_BLOCKED, langConfig.getString("message.double-chest-blocked", "&cThere must not be a block above the chest."))); diff --git a/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java b/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java index 1cbc96e..b155999 100644 --- a/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java +++ b/src/main/java/de/epiceric/shopchest/language/LocalizedMessage.java @@ -43,6 +43,7 @@ public class LocalizedMessage { public enum Message { SHOP_CREATED, + ADMIN_SHOP_CREATED, CHEST_ALREADY_SHOP, CHEST_BLOCKED, DOUBLE_CHEST_BLOCKED, diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java index 6c6046b..4ff9be6 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java @@ -644,7 +644,8 @@ public class ShopInteractListener implements Listener { EconomyResponse r = plugin.getEconomy().withdrawPlayer(executor, location.getWorld().getName(), creationPrice); if (!r.transactionSuccess()) { plugin.debug("Economy transaction failed: " + r.errorMessage); - executor.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.ERROR_OCCURRED, new LocalizedMessage.ReplacedPlaceholder(Placeholder.ERROR, r.errorMessage))); + executor.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.ERROR_OCCURRED, + new LocalizedMessage.ReplacedPlaceholder(Placeholder.ERROR, r.errorMessage))); return; } @@ -653,7 +654,14 @@ public class ShopInteractListener implements Listener { plugin.debug("Shop created"); shopUtils.addShop(shop, true); - executor.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.SHOP_CREATED)); + LocalizedMessage.ReplacedPlaceholder placeholder = new LocalizedMessage.ReplacedPlaceholder( + Placeholder.CREATION_PRICE, String.valueOf(creationPrice)); + + if (shopType == ShopType.ADMIN) { + executor.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.ADMIN_SHOP_CREATED, placeholder)); + } else { + executor.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.SHOP_CREATED, placeholder)); + } for (Player p : location.getWorld().getPlayers()) { if (p.getLocation().distanceSquared(location) <= Math.pow(config.maximal_distance, 2)) { diff --git a/src/main/resources/lang/de_DE.lang b/src/main/resources/lang/de_DE.lang index d6b11fb..378c53d 100644 --- a/src/main/resources/lang/de_DE.lang +++ b/src/main/resources/lang/de_DE.lang @@ -1,4 +1,5 @@ -message.shop-created=&6Shop erstellt. +message.shop-created=&6Dir wurden &c%CREATION-PRICE% abgenommen, um diesen Shop zu erstellen. +message.admin-shop-created=&6Dir wurden &c%CREATION-PRICE% abgenommen, um diesen Admin Shop zu erstellen. message.chest-already-shop=&cTruhe ist bereits ein Shop. message.chest-blocked=&cÜber der Truhe ist kein Platz. message.double-chest-blocked=&cÜber der Truhe ist kein Platz. diff --git a/src/main/resources/lang/en_US.lang b/src/main/resources/lang/en_US.lang index 407cdf1..1484142 100644 --- a/src/main/resources/lang/en_US.lang +++ b/src/main/resources/lang/en_US.lang @@ -1,5 +1,10 @@ # Set the message when a shop is created at the clicked chest. -message.shop-created=&6Shop created. +# Usable Placeholders: %CREATION-PRICE% +message.shop-created=&6You were withdrawn &c%CREATION-PRICE% &6to create this shop. + +# Set the message when an admin shop is created at the clicked chest. +# Usable Placeholders: %CREATION-PRICE% +message.admin-shop-created=&6You were withdrawn &c%CREATION-PRICE% &6to create this admin shop. # Set the message when the clicked chest already is a shop. message.chest-already-shop=&cChest already is shop.