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,72 @@
|
||||
package tconstruct.tools.modifiers;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ModReinforced extends ModInteger
|
||||
{
|
||||
|
||||
public ModReinforced(ItemStack[] items, int effect, int increase)
|
||||
{
|
||||
super(items, effect, StatCollector.translateToLocal("modifier.tool.reinforced"), 1, "\u00a75", StatCollector.translateToLocal("modifier.tool.reinforced"));
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
int reinforced = tags.getInteger("Unbreaking");
|
||||
reinforced += 1;
|
||||
tags.setInteger("Unbreaking", reinforced);
|
||||
|
||||
addToolTip(tool, color + tooltipName, color + key);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int addToolTip (ItemStack tool, String tooltip, String modifierTip)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
int tipNum = 0;
|
||||
while (true)
|
||||
{
|
||||
tipNum++;
|
||||
String tip = "Tooltip" + tipNum;
|
||||
if (!tags.hasKey(tip))
|
||||
{
|
||||
// tags.setString(tip, tooltip);
|
||||
String modTip = "ModifierTip" + tipNum;
|
||||
String tag = tags.getString(modTip);
|
||||
tags.setString(modTip, getProperName(modifierTip, tag));
|
||||
return tipNum;
|
||||
}
|
||||
else
|
||||
{
|
||||
String modTip = "ModifierTip" + tipNum;
|
||||
String tag = tags.getString(modTip);
|
||||
if (tag.contains(modifierTip))
|
||||
{
|
||||
// tags.setString(tip, getProperName(tooltip, tag));
|
||||
tag = tags.getString(modTip);
|
||||
tags.setString(modTip, getProperName(modifierTip, tag));
|
||||
return tipNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user