Jump to content

silenthunder2

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

silenthunder2's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Wouldn't that only work if I was trying to repair the repair catalyst? Like I would have to be trying to repair a silver ingot. This.itemID returns the ID of the tool I'm putting into the anvil, right?
  2. So I'm learning to mod, and I've made a couple new materials, Silver and Electrum. Everything works but repair; i.e the pickaxes function as a normal pickaxe except they can't be repaired at an anvil. I want to make them repairable as well as enchantable and I want to do this so that I only need to make one pickaxe class. I need to keep each tool an extension of the vanilla tool class so it can be enchanted. The only way I can get the tools repairable with these requirements is by changing this: public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } To this: public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { return SunMod.silverIngot.itemID == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); } But of course when I make an Electrum tool, this makes it repairable only by silver ingots, which is obviously not correct. If that's the only way to do it that means I have to make a new class for every tool from every material, which I'd like to avoid. Another way is editing the base classes, but I'd really like to avoid that if possible. Can anyone help? Here's my pickaxe class: And my main mod class: Thanks!
  3. So I've been following tutorials and learning how to work with forge, and I've got a new material that can be made into tools. For some reason, I can't enchant any of them. Here's some example code for the pickaxe: And my main class: Is there something that I'm missing to make them enchantable?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.