Toops / TinkersSteelworks

A steel-based expansion for Tinkers' Construct.
Other
20 stars 20 forks source link

Steel armor cannot been repaired in anvil? #41

Closed ProgrammedSoul closed 10 years ago

ProgrammedSoul commented 10 years ago

I just tried to put a enchanted and damaged steel armor in a anvil, and add some steel ingot, but it don't seems to be work. Then I tried in SSP and it seems steel armor is not compatible with anvil mechanic. I don't know if this issue should be a bug or improvement...But if possible please fix it. Thanks for your attention. I'm using TSteelworks-mc1.6.4-0.0.4.2, minecraft 1.6.4 with latest recommended forge.

wisthy commented 10 years ago

I don't think it's a bug. But it's clearly something we can discuss to add.

ProgrammedSoul commented 10 years ago

Nice. I will store my armor for now and wait for update :D Any way thanks for your awesome work!

Toops commented 10 years ago

@wisthy is correct - it's not technically a bug, but it's also not intended. Oddly, I never tested enchanting on steel armor, so I wasn't aware of this. So we'll get that going for the next release as well.

wisthy commented 10 years ago

@Toops apparently, it should be methods on class Item. As I don't have access to that class from work, I cannot help you more than that for now.

For the enchant, it looks like a boolean method with the enchantID in input. So, you will have to list all the allowed enchants for each part.

public boolean acceptsEnchant(int paramInt) {
    ...
}

For the repair, I've found the method below but I don't see where you specify which material you have to use to repair...

public boolean isRepairable(){
    ...
}
ProgrammedSoul commented 10 years ago

I didn't tested but sense TSArmorBasic extends ItemArmor, add this method into TSArmorBasic might work:

@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
        return (something represent itemID of stell ingot) == par2ItemStack.itemID ? true :false;
}
wisthy commented 10 years ago

it will work that way but I think we will keep the method unchanged and just adapt the EnumArmorMaterial to add Steel in it as "customCraftingMaterial"

Test in progress

wisthy commented 10 years ago

And I can now enchant and repair steel armor in an anvil.

It will be delivered in the next release (probably with the hotfix for Toops#42)