Use the correct SalesPackageBase for gadgets

This commit is contained in:
cnr 2016-08-07 22:40:26 -04:00
parent 0ca4fe2d38
commit 4180f03a52

View File

@ -372,7 +372,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
UtilPlayer.message(player, F.main("Disguise", "You cant buy things while you are disguised!"));
return;
}
getShop().openPageForPlayer(getPlayer(), new ConfirmationPage<>(player, this, new SalesPackageProcessor(player, GlobalCurrency.TREASURE_SHARD, gadget, getDonationManager(), () ->
getShop().openPageForPlayer(getPlayer(), new ConfirmationPage<>(player, this, new SalesPackageProcessor(player, GlobalCurrency.TREASURE_SHARD, (gadget instanceof ItemGadget ? ((ItemGadget) gadget).getAmmo() : gadget), getDonationManager(), () ->
{
getPlugin().getInventoryManager().addItemToInventory(getPlayer(), gadget.getName(), (gadget instanceof ItemGadget ? ((ItemGadget) gadget).getAmmo().getQuantity() : gadget.getQuantity()));
refresh();