mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-09 20:21:07 +00:00
Added notification for withdrawal of shop creation price
This commit is contained in:
parent
de2046e6b5
commit
18d3e36390
@ -997,7 +997,8 @@ public class LanguageUtils {
|
|||||||
generationNames.add(new BookGenerationName(CustomBookMeta.Generation.TATTERED, langConfig.getString("book.generation.3", "Tattered")));
|
generationNames.add(new BookGenerationName(CustomBookMeta.Generation.TATTERED, langConfig.getString("book.generation.3", "Tattered")));
|
||||||
|
|
||||||
// Add ShopChest Messages
|
// 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_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.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.")));
|
messages.add(new LocalizedMessage(LocalizedMessage.Message.DOUBLE_CHEST_BLOCKED, langConfig.getString("message.double-chest-blocked", "&cThere must not be a block above the chest.")));
|
||||||
|
@ -43,6 +43,7 @@ public class LocalizedMessage {
|
|||||||
|
|
||||||
public enum Message {
|
public enum Message {
|
||||||
SHOP_CREATED,
|
SHOP_CREATED,
|
||||||
|
ADMIN_SHOP_CREATED,
|
||||||
CHEST_ALREADY_SHOP,
|
CHEST_ALREADY_SHOP,
|
||||||
CHEST_BLOCKED,
|
CHEST_BLOCKED,
|
||||||
DOUBLE_CHEST_BLOCKED,
|
DOUBLE_CHEST_BLOCKED,
|
||||||
|
@ -644,7 +644,8 @@ public class ShopInteractListener implements Listener {
|
|||||||
EconomyResponse r = plugin.getEconomy().withdrawPlayer(executor, location.getWorld().getName(), creationPrice);
|
EconomyResponse r = plugin.getEconomy().withdrawPlayer(executor, location.getWorld().getName(), creationPrice);
|
||||||
if (!r.transactionSuccess()) {
|
if (!r.transactionSuccess()) {
|
||||||
plugin.debug("Economy transaction failed: " + r.errorMessage);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,7 +654,14 @@ public class ShopInteractListener implements Listener {
|
|||||||
plugin.debug("Shop created");
|
plugin.debug("Shop created");
|
||||||
shopUtils.addShop(shop, true);
|
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()) {
|
for (Player p : location.getWorld().getPlayers()) {
|
||||||
if (p.getLocation().distanceSquared(location) <= Math.pow(config.maximal_distance, 2)) {
|
if (p.getLocation().distanceSquared(location) <= Math.pow(config.maximal_distance, 2)) {
|
||||||
|
@ -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-already-shop=&cTruhe ist bereits ein Shop.
|
||||||
message.chest-blocked=&cÜber der Truhe ist kein Platz.
|
message.chest-blocked=&cÜber der Truhe ist kein Platz.
|
||||||
message.double-chest-blocked=&cÜber der Truhe ist kein Platz.
|
message.double-chest-blocked=&cÜber der Truhe ist kein Platz.
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
# Set the message when a shop is created at the clicked chest.
|
# 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.
|
# Set the message when the clicked chest already is a shop.
|
||||||
message.chest-already-shop=&cChest already is shop.
|
message.chest-already-shop=&cChest already is shop.
|
||||||
|
Loading…
Reference in New Issue
Block a user