mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
Reorganize folders for modules
This commit is contained in:
1 parent
2c14f315de
commit
e2f0558b6f
370 files changed
+4274
-4788
No files matched your search
@@ -0,0 +1,55 @@
|
||||
package tconstruct.tools.modifiers;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.library.tools.ToolMod;
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user