mirror of
https://github.com/Flowsqy/ShopChest.git
synced 2024-12-04 02:23:22 +01:00
Merge branch 'feature/clean-project' of https://github.com/Flowsqy/ShopChest into feature/clean-project
This commit is contained in:
commit
355572f7f3
@ -280,6 +280,10 @@ public class ShopInteractListener implements Listener {
|
|||||||
ItemStack itemStack = shop.getProduct().getItemStack();
|
ItemStack itemStack = shop.getProduct().getItemStack();
|
||||||
int amount = (p.isSneaking() ? itemStack.getMaxStackSize() : shop.getProduct().getAmount());
|
int amount = (p.isSneaking() ? itemStack.getMaxStackSize() : shop.getProduct().getAmount());
|
||||||
|
|
||||||
|
// If shop has higher amounts than a stack, use the shop amount to allow players to use bulk discount
|
||||||
|
if(shop.getProduct().getAmount()>itemStack.getMaxStackSize())
|
||||||
|
amount = shop.getProduct().getAmount();
|
||||||
|
|
||||||
if (Utils.getAmount(c.getInventory(), itemStack) >= amount) {
|
if (Utils.getAmount(c.getInventory(), itemStack) >= amount) {
|
||||||
if (confirmed || !Config.confirmShopping) {
|
if (confirmed || !Config.confirmShopping) {
|
||||||
buy(p, shop, p.isSneaking());
|
buy(p, shop, p.isSneaking());
|
||||||
@ -636,7 +640,7 @@ public class ShopInteractListener implements Listener {
|
|||||||
|
|
||||||
ItemStack itemStack = shop.getProduct().getItemStack();
|
ItemStack itemStack = shop.getProduct().getItemStack();
|
||||||
int amount = shop.getProduct().getAmount();
|
int amount = shop.getProduct().getAmount();
|
||||||
if (stack) amount = itemStack.getMaxStackSize();
|
if (stack && amount<=shop.getProduct().getAmount()) amount = itemStack.getMaxStackSize();
|
||||||
|
|
||||||
String worldName = shop.getLocation().getWorld().getName();
|
String worldName = shop.getLocation().getWorld().getName();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user