Use ClientInventory#addItem

This commit is contained in:
ArcticZeroo 2018-01-09 19:29:01 -05:00 committed by Alexander Meech
parent 5c80b002b1
commit 4d3a5e8756

View File

@ -22,6 +22,8 @@ import mineplex.core.common.util.UtilSkull;
import mineplex.core.common.util.UtilText;
import mineplex.core.donation.Donor;
import mineplex.core.donation.repository.token.TransactionToken;
import mineplex.core.inventory.ClientInventory;
import mineplex.core.inventory.ClientItem;
import mineplex.core.server.util.TransactionResponse;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase;
@ -167,7 +169,9 @@ public class SupportPage extends ShopPageBase<CustomerSupport, SupportShop>
private void addItemsToClient(int amount, String itemName)
{
getPlugin().getInventoryManager().Get(_target.getUniqueId()).getClientItem(itemName).Count += amount;
ClientInventory clientInventory = getPlugin().getInventoryManager().Get(_target.getUniqueId());
clientInventory.addItem(new ClientItem(getPlugin().getInventoryManager().getItem(itemName), amount));
}
protected void giveUnknownSalesPackage(int amount, String itemName, boolean isItem, Consumer<Boolean>callback)