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,58 @@
package tconstruct.modifiers.armor;
import java.util.EnumSet;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.armor.ArmorMod;
import tconstruct.library.armor.ArmorPart;
/* Adds an integer NBTTag */
public class AModInteger extends ArmorMod
{
String color;
String tooltipName;
int initialIncrease;
int secondaryIncrease;
public AModInteger(int effect, String dataKey, EnumSet<ArmorPart> armorTypes, ItemStack[] items, int increase, String c, String tip)
{
super(effect, dataKey, armorTypes, items);
initialIncrease = secondaryIncrease = increase;
color = c;
tooltipName = tip;
}
public AModInteger(int effect, String dataKey, EnumSet<ArmorPart> armorTypes, ItemStack[] items, int increase1, int increase2, String c, String tip)
{
super(effect, dataKey, armorTypes, items);
initialIncrease = increase1;
secondaryIncrease = increase2;
color = c;
tooltipName = tip;
}
@Override
public void modify (ItemStack[] recipe, ItemStack input)
{
NBTTagCompound tags = getModifierTag(input);
if (tags.hasKey(key))
{
int increase = tags.getInteger(key);
increase += secondaryIncrease;
tags.setInteger(key, increase);
}
else
{
tags.setInteger(key, initialIncrease);
}
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
addToolTip(input, color + tooltipName, color + key);
}
}