mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 15:44:30 +00:00
1.7.10 Files
Files added
This commit is contained in:
1 parent
393ea9b463
commit
a31efb2dc3
1768 files changed
+84831
No files matched your search
@@ -0,0 +1,48 @@
|
||||
package noppes.npcs.containers;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
class SlotNPCArmor extends Slot
|
||||
{
|
||||
|
||||
final int armorType; /* synthetic field */
|
||||
|
||||
SlotNPCArmor(IInventory iinventory, int i, int j, int k, int l)
|
||||
{
|
||||
super(iinventory, i, j, k);
|
||||
armorType = l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getBackgroundIconIndex()
|
||||
{
|
||||
return ItemArmor.func_94602_b(this.armorType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemstack)
|
||||
{
|
||||
if(itemstack.getItem() instanceof ItemArmor)
|
||||
{
|
||||
return ((ItemArmor)itemstack.getItem()).armorType == armorType;
|
||||
}
|
||||
if(itemstack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
return armorType == 0;
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user