Use ClientInventory#addItem
This commit is contained in:
parent
5c80b002b1
commit
4d3a5e8756
@ -22,6 +22,8 @@ import mineplex.core.common.util.UtilSkull;
|
|||||||
import mineplex.core.common.util.UtilText;
|
import mineplex.core.common.util.UtilText;
|
||||||
import mineplex.core.donation.Donor;
|
import mineplex.core.donation.Donor;
|
||||||
import mineplex.core.donation.repository.token.TransactionToken;
|
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.server.util.TransactionResponse;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
@ -167,7 +169,9 @@ public class SupportPage extends ShopPageBase<CustomerSupport, SupportShop>
|
|||||||
|
|
||||||
private void addItemsToClient(int amount, String itemName)
|
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)
|
protected void giveUnknownSalesPackage(int amount, String itemName, boolean isItem, Consumer<Boolean>callback)
|
||||||
|
Loading…
Reference in New Issue
Block a user