mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 10:22:29 +00:00
Don't check vendor balance at admin shops
Should fix errors with economy plugins when the vendor does not have a valid name.
This commit is contained in:
parent
1a0920f239
commit
148295ddb4
@ -1120,8 +1120,12 @@ public class ShopInteractListener implements Listener {
|
||||
|
||||
String worldName = shop.getLocation().getWorld().getName();
|
||||
|
||||
if (econ.getBalance(shop.getVendor(), worldName) >= price || shop.getShopType() == ShopType.ADMIN || Config.autoCalculateItemAmount) {
|
||||
int amountForMoney = (int) (amount / price * econ.getBalance(shop.getVendor(), worldName));
|
||||
if (shop.getShopType() == ShopType.ADMIN || econ.getBalance(shop.getVendor(), worldName) >= price || Config.autoCalculateItemAmount) {
|
||||
int amountForMoney = 1;
|
||||
|
||||
if (shop.getShopType() != ShopType.ADMIN) {
|
||||
amountForMoney = (int) (amount / price * econ.getBalance(shop.getVendor(), worldName));
|
||||
}
|
||||
|
||||
plugin.debug("Vendor has enough money for " + amountForMoney + " item(s) (#" + shop.getID() + ")");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user