Update modifiers, start travellers gear

This commit is contained in:
mDiyo committed 2014-06-30 22:26:00 -08:00
1 parent 0230307f0a
commit c525493545
96 files changed
+2827 -1573

No files matched your search

@@ -0,0 +1,53 @@
package tconstruct.modifiers.armor;
import java.util.EnumSet;
import java.util.UUID;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import tconstruct.library.armor.ArmorPart;
public class AModLeadBoots extends AModBoolean
{
public AModLeadBoots(ItemStack[] items)
{
super(2, "LeadBoots", EnumSet.of(ArmorPart.Feet), items, "\u00a78", "Lead Boots");
}
@Override
public void modify (ItemStack[] recipe, ItemStack armor)
{
NBTTagCompound baseTag = armor.getTagCompound();
NBTTagCompound armorTag = armor.getTagCompound().getCompoundTag(getTagName(armor));
armorTag.setBoolean(key, true);
int modifiers = armorTag.getInteger("Modifiers");
modifiers -= 1;
armorTag.setInteger("Modifiers", modifiers);
addToolTip(armor, color + tooltipName, color + key);
NBTTagList attributes;
if (baseTag.hasKey("AttributeModifiers"))
{
attributes = baseTag.getTagList("AttributeModifiers", 0);
for (int iter = 0; iter < attributes.tagCount(); iter++)
{
NBTTagCompound tag = (NBTTagCompound) attributes.getCompoundTagAt(iter);
if (tag.getString("AttributeName").equals("generic.knockbackResistance"))
attributes.removeTag(iter);
}
}
else
{
attributes = new NBTTagList();
baseTag.setTag("AttributeModifiers", attributes);
}
attributes.appendTag(getAttributeTag("generic.knockbackResistance", key, 0.4, true, shoes));
}
private static final UUID shoes = UUID.fromString("4188779d-69d4-487c-b307-c4c182522c47");
}