From 289a96fab73bb9895138bfbf311ef058481563e9 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Fri, 24 May 2019 12:52:55 +0800 Subject: [PATCH] Fix #81 Former-commit-id: 5ae66028ed476016947eed1d831d5a1082ccb56a [formerly 76d54ce3af2c7b9b5b538447bb96e5903673ce41] Former-commit-id: 4af9b21f68e05445ba33696808f3fe202a3096bd --- .../org/maxgamer/quickshop/Shop/ShopManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java index da2656f96..1f01ce2bc 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java @@ -412,13 +412,13 @@ public class ShopManager { if(space == -1) space=10000; if (space < amount) { - p.sendMessage(MsgUtil.getMessage("shop-has-no-space", "" + space, shop.getDataName())); + p.sendMessage(MsgUtil.getMessage("shop-has-no-space", "" + space, MsgUtil.getItemi18n(shop.getItem().getType().name()))); return; } int count = Util.countItems(p.getInventory(), shop.getItem()); // Not enough items if (amount > count) { - p.sendMessage(MsgUtil.getMessage("you-dont-have-that-many-items", "" + count, shop.getDataName())); + p.sendMessage(MsgUtil.getMessage("you-dont-have-that-many-items", "" + count, MsgUtil.getItemi18n(shop.getItem().getType().name()))); return; } if (amount == 0) { @@ -463,7 +463,7 @@ public class ShopManager { // Give them the money after we know we succeeded plugin.getEcon().deposit(p.getUniqueId(), total * (1 - tax)); // Notify the owner of the purchase. - String msg = MsgUtil.getMessage("player-sold-to-your-store", p.getName(), "" + amount, shop.getDataName()); + String msg = MsgUtil.getMessage("player-sold-to-your-store", p.getName(), "" + amount, MsgUtil.getItemi18n(shop.getItem().getType().name())); if (space == amount) msg += "\n" + MsgUtil.getMessage("shop-out-of-space", "" + shop.getLocation().getBlockX(), "" + shop.getLocation().getBlockY(), "" + shop.getLocation().getBlockZ()); MsgUtil.send(shop.getOwner(), msg,shop.isUnlimited()); @@ -489,7 +489,7 @@ public class ShopManager { if(stock==-1) stock=10000; if (stock < amount) { - p.sendMessage(MsgUtil.getMessage("shop-stock-too-low", "" + shop.getRemainingStock(), shop.getDataName())); + p.sendMessage(MsgUtil.getMessage("shop-stock-too-low", "" + shop.getRemainingStock(), MsgUtil.getItemi18n(shop.getItem().getType().name()))); return; } if (amount == 0) { @@ -539,14 +539,14 @@ public class ShopManager { } // Notify the shop owner if (plugin.getConfig().getBoolean("show-tax")) { - String msg = MsgUtil.getMessage("player-bought-from-your-store-tax", p.getName(), "" + amount, shop.getDataName(), Util.format((tax * total))); + String msg = MsgUtil.getMessage("player-bought-from-your-store-tax", p.getName(), "" + amount, MsgUtil.getItemi18n(shop.getItem().getType().name()), Util.format((tax * total))); if (stock == amount) - msg += "\n" + MsgUtil.getMessage("shop-out-of-stock", "" + shop.getLocation().getBlockX(), "" + shop.getLocation().getBlockY(), "" + shop.getLocation().getBlockZ(), shop.getDataName()); + msg += "\n" + MsgUtil.getMessage("shop-out-of-stock", "" + shop.getLocation().getBlockX(), "" + shop.getLocation().getBlockY(), "" + shop.getLocation().getBlockZ(), MsgUtil.getItemi18n(shop.getItem().getType().name())); MsgUtil.send(shop.getOwner(), msg, shop.isUnlimited()); } else { - String msg = MsgUtil.getMessage("player-bought-from-your-store", p.getName(), "" + amount, shop.getDataName()); + String msg = MsgUtil.getMessage("player-bought-from-your-store", p.getName(), "" + amount, MsgUtil.getItemi18n(shop.getItem().getType().name())); if (stock == amount) - msg += "\n" + MsgUtil.getMessage("shop-out-of-stock", "" + shop.getLocation().getBlockX(), "" + shop.getLocation().getBlockY(), "" + shop.getLocation().getBlockZ(), shop.getDataName()); + msg += "\n" + MsgUtil.getMessage("shop-out-of-stock", "" + shop.getLocation().getBlockX(), "" + shop.getLocation().getBlockY(), "" + shop.getLocation().getBlockZ(), MsgUtil.getItemi18n(shop.getItem().getType().name())); MsgUtil.send(shop.getOwner(), msg, shop.isUnlimited()); } // Transfers the item from A to B