mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
Initial crashless build
This commit is contained in:
1 parent
2f5d798753
commit
1bb3c4cf7b
1162 files changed
+2913
-3311
No files matched your search
@@ -0,0 +1,41 @@
|
||||
package mods.tinker.tconstruct.modifiers;
|
||||
|
||||
import mods.tinker.common.ToolMod;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/* Little mod for actually adding the lapis modifier */
|
||||
|
||||
public class ModLapisBase extends ToolMod
|
||||
{
|
||||
public ModLapisBase(ItemStack[] items, int effect)
|
||||
{
|
||||
super(items, effect, "Lapis");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canModify (ItemStack tool, ItemStack[] input)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
if (!tags.hasKey(key))
|
||||
return tags.getInteger("Modifiers") > 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modify (ItemStack[] input, ItemStack tool)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
tags.setBoolean(key, true);
|
||||
|
||||
String modName = "\u00a79Lapis (0/100)";
|
||||
int tooltipIndex = addToolTip(tool, "\u00a79Luck", modName);
|
||||
int[] keyPair = new int[] { 0, tooltipIndex };
|
||||
tags.setIntArray(key, keyPair);
|
||||
|
||||
int modifiers = tags.getInteger("Modifiers");
|
||||
modifiers -= 1;
|
||||
tags.setInteger("Modifiers", modifiers);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user