Former-commit-id: 5ae66028ed476016947eed1d831d5a1082ccb56a [formerly 76d54ce3af2c7b9b5b538447bb96e5903673ce41]
Former-commit-id: 4af9b21f68e05445ba33696808f3fe202a3096bd
This commit is contained in:
Ghost_chu committed 2019-05-24 12:52:55 +08:00
1 parent 970d348a2d
commit 289a96fab7
1 file changed
+8 -8
@@ -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