add get reset disable purchase num by slot number and IPlayer

needed to add get/setStringIntegerArrayMap to NBTTags so save the player purchases and disabled slots with a String int[] hashmap
This commit is contained in:
1whohears committed 2022-05-26 15:57:24 -05:00
1 parent e7250158ac
commit 3cf780d9a2
4 files changed
+141 -13

No files matched your search

@@ -68,12 +68,12 @@ public class ContainerNPCTrader extends ContainerNpcInterface{
NoppesUtilPlayer.consumeItem(entityplayer, role.inventoryCurrency.getStackInSlot(i + 18), role.ignoreDamage, role.ignoreNBT);
ItemStack soldItem = item.copy();
givePlayer(soldItem, entityplayer);
++role.purchases[i];
role.addPurchase(i, entityplayer);
return soldItem;
}
public boolean isSlotEnabled(int slot, EntityPlayer player) {
return role.disableSlot[slot] == 0;
return role.isSlotEnabled(slot, player);
}
public boolean canBuy(int slot, EntityPlayer player) {
ItemStack currency = role.inventoryCurrency.getStackInSlot(slot);