mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-13 22:21:06 +00:00
On admin and infinite shops, the player must have enough items
This commit is contained in:
parent
c4bc318a25
commit
4c022dd9dc
@ -205,12 +205,20 @@ public class InteractShop implements Listener{
|
|||||||
if (perm.has(p, "shopchest.sell")) {
|
if (perm.has(p, "shopchest.sell")) {
|
||||||
if (shop.getShopType() == ShopType.INFINITE) {
|
if (shop.getShopType() == ShopType.INFINITE) {
|
||||||
if (!shop.getVendor().getUniqueId().equals(p.getUniqueId())) {
|
if (!shop.getVendor().getUniqueId().equals(p.getUniqueId())) {
|
||||||
|
if (Utils.getAmount(p.getInventory(), shop.getProduct().getType(), shop.getProduct().getDurability(), shop.getProduct().getItemMeta()) >= shop.getProduct().getAmount()) {
|
||||||
sell(p, shop);
|
sell(p, shop);
|
||||||
|
} else {
|
||||||
|
p.sendMessage(Config.not_enough_items());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
e.setCancelled(false);
|
e.setCancelled(false);
|
||||||
}
|
}
|
||||||
} else if (shop.getShopType() == ShopType.ADMIN) {
|
} else if (shop.getShopType() == ShopType.ADMIN) {
|
||||||
|
if (Utils.getAmount(p.getInventory(), shop.getProduct().getType(), shop.getProduct().getDurability(), shop.getProduct().getItemMeta()) >= shop.getProduct().getAmount()) {
|
||||||
sell(p, shop);
|
sell(p, shop);
|
||||||
|
} else {
|
||||||
|
p.sendMessage(Config.not_enough_items());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!shop.getVendor().getUniqueId().equals(p.getUniqueId())) {
|
if (!shop.getVendor().getUniqueId().equals(p.getUniqueId())) {
|
||||||
if (Utils.getAmount(p.getInventory(), shop.getProduct().getType(), shop.getProduct().getDurability(), shop.getProduct().getItemMeta()) >= shop.getProduct().getAmount()) {
|
if (Utils.getAmount(p.getInventory(), shop.getProduct().getType(), shop.getProduct().getDurability(), shop.getProduct().getItemMeta()) >= shop.getProduct().getAmount()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user