Allow repairing gem tools and armor in anvil
This commit is contained in:
parent
93e324cc11
commit
548d393820
7 changed files with 144 additions and 36 deletions
|
@ -25,14 +25,32 @@
|
|||
package techreborn.items.tools;
|
||||
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
||||
public class ItemTRSpade extends ItemSpade {
|
||||
|
||||
String repairOreDict = "";
|
||||
|
||||
public ItemTRSpade(ToolMaterial material) {
|
||||
this(material, "");
|
||||
}
|
||||
|
||||
public ItemTRSpade(ToolMaterial material, String repairOreDict) {
|
||||
super(material);
|
||||
this.repairOreDict = repairOreDict;
|
||||
setUnlocalizedName(material.name().toLowerCase() + "Spade");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) {
|
||||
if(toRepair.getItem() == this && !repairOreDict.isEmpty()){
|
||||
return ItemUtils.isInputEqual(repairOreDict, repair, false, false, true);
|
||||
}
|
||||
return super.getIsRepairable(toRepair, repair);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue