Skip to content

Commit

Permalink
Fixed armor slots to only allow the correct type of armor in the slot…
Browse files Browse the repository at this point in the history
…s. Kept the abbility to wear blocks on your head
  • Loading branch information
unleashurgeek committed Dec 10, 2013
1 parent 9a578fc commit daa2368
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tconstruct/inventory/SlotArmorCopy.java
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
Expand Down Expand Up @@ -44,7 +45,11 @@ public int getSlotStackLimit ()
public boolean isItemValid (ItemStack par1ItemStack)
{
Item item = (par1ItemStack == null ? null : par1ItemStack.getItem());
return item != null;// && item.isValidArmor(par1ItemStack, armorType, parent.thePlayer);
boolean isValidArmor = false;
if (item instanceof ItemArmor) {
isValidArmor = (((ItemArmor)item).armorType == armorType);
}
return item != null && (isValidArmor || (item instanceof ItemBlock && armorType == 0));
}

@SideOnly(Side.CLIENT)
Expand Down

0 comments on commit daa2368

Please sign in to comment.