added trader.slotdisabled to trader gui

I just copied what was done to display the trader.insufficient and added trader.slotdisabled to en_US.lang
This commit is contained in:
1whohears committed 2022-05-26 01:43:17 -05:00
1 parent aba637be14
commit 422dd3fc90
5 files changed
+19 -3

No files matched your search

@@ -62,6 +62,8 @@ public class ContainerNPCTrader extends ContainerNpcInterface{
return null;
if(!canBuy(i, entityplayer))
return null;
if (!isSlotEnabled(i, entityplayer))
return null;
NoppesUtilPlayer.consumeItem(entityplayer, role.inventoryCurrency.getStackInSlot(i), role.ignoreDamage, role.ignoreNBT);
NoppesUtilPlayer.consumeItem(entityplayer, role.inventoryCurrency.getStackInSlot(i + 18), role.ignoreDamage, role.ignoreNBT);
ItemStack soldItem = item.copy();
@@ -70,12 +72,14 @@ public class ContainerNPCTrader extends ContainerNpcInterface{
return soldItem;
}
public boolean isSlotEnabled(int slot, EntityPlayer player) {
return role.disableSlot[slot] == 0;
}
public boolean canBuy(int slot, EntityPlayer player) {
ItemStack currency = role.inventoryCurrency.getStackInSlot(slot);
ItemStack currency2 = role.inventoryCurrency.getStackInSlot(slot + 18);
if(currency == null && currency2 == null)
return true;
if (role.disableSlot[slot] > 0) return false;
if(currency == null){
currency = currency2;
currency2 = null;