Restructure with build file (Ant)

This commit is contained in:
Sunstrike committed 2013-09-01 15:31:28 +01:00
1 parent 8ce338dd58
commit 087b33feb7
4039 files changed
+219

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
package tconstruct.modifiers;
import tconstruct.library.tools.ToolMod;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
/* Adds an integer NBTTag */
public class ModInteger extends ToolMod
{
String color;
String tooltipName;
int initialIncrease;
int secondaryIncrease;
public ModInteger(ItemStack[] items, int effect, String dataKey, int increase, String c, String tip)
{
super(items, effect, dataKey);
initialIncrease = secondaryIncrease = increase;
color = c;
tooltipName = tip;
}
public ModInteger(ItemStack[] items, int effect, String dataKey, int increase1, int increase2, String c, String tip)
{
super(items, effect, dataKey);
initialIncrease = increase1;
secondaryIncrease = increase2;
color = c;
tooltipName = tip;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
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(tool, color + tooltipName, color + key);
}
}