Skip to content

Commit

Permalink
Update ShopMenu.java
Browse files Browse the repository at this point in the history
Dropping overflow items to player location
  • Loading branch information
BrokenKage committed Nov 27, 2020
1 parent 46963fc commit 14a13d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/net/peacefulcraft/tarje/shop/ShopMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ public void onPurchaseQuantityInventoryClick(Player p, String title, ItemStack i
}

Tarje._this().getEconomyService().withdrawPlayer(p, purcahsePrice);
p.getInventory().addItem(new ItemStack(shopItem.getItem(), purchaseQuantity));
HashMap<Integer, ItemStack> leftovers = p.getInventory().addItem(new ItemStack(shopItem.getItem(), purchaseQuantity));
for(ItemStack temp : leftovers.values()) {
p.getLocation().getWorld().dropItemNaturally(p.getLocation(), temp);
}
p.sendMessage(Tarje.messagingPrefix + "You bought " + purchaseQuantity + " " + shopItem.getItem() + " for $" + purcahsePrice + ".");
}

Expand Down

0 comments on commit 14a13d5

Please sign in to comment.