Quartz Modifier

This commit is contained in:
mDiyo committed 2013-04-10 04:09:19 -07:00
1 parent 41a0e80078
commit a4d318f059
62 files changed
+2593 -1400

No files matched your search

@@ -0,0 +1,39 @@
package mods.tinker.tconstruct.modifiers;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.crafting.PatternBuilder;
public class ModExtraModifier extends ToolMod
{
public ModExtraModifier(ItemStack[] items, String dataKey)
{
super(items, 0, dataKey);
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
if ((input[0] == null && input[1] == null) || (input[0] != null && input[1] != null)) //Only valid for one itemstack
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.getBoolean(key))
{
return false;
}
return true;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean(key, true);
int modifiers = tags.getInteger("Modifiers");
tags.setInteger("Modifiers", modifiers + 1);
}
}