mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 21:20:06 +00:00
Update modifiers, start travellers gear
This commit is contained in:
1 parent
0230307f0a
commit
c525493545
96 files changed
+2827
-1573
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package tconstruct.modifiers.tools;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.library.modifier.IModifyable;
|
||||
import tconstruct.library.modifier.ItemModifier;
|
||||
|
||||
public class ModExtraModifier extends ItemModifier
|
||||
{
|
||||
public ModExtraModifier(ItemStack[] items, String dataKey)
|
||||
{
|
||||
super(items, 0, dataKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canModify (ItemStack tool, ItemStack[] recipe)
|
||||
{
|
||||
if (tool != null && tool.getItem() instanceof IModifyable)
|
||||
{
|
||||
NBTTagCompound tags = this.getModifierTag(tool);
|
||||
if (tags.getBoolean(key))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modify (ItemStack[] recipe, ItemStack input)
|
||||
{
|
||||
NBTTagCompound tags = this.getModifierTag(input);
|
||||
tags.setBoolean(key, true);
|
||||
int modifiers = tags.getInteger("Modifiers");
|
||||
modifiers += 1;
|
||||
tags.setInteger("Modifiers", modifiers);
|
||||
}
|
||||
|
||||
public void addMatchingEffect (ItemStack tool)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user