mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 01:05:12 +00:00
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:
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;
|
||||
|
||||
Reference in new issue
Block a user