smartaleq / DwarfCraft_orig

A Minecraft RPG mod introducing additional difficulties, levels, and progression.
3 stars 0 forks source link

When Item broken it removes all items of that type #12

Closed smartaleq closed 13 years ago

smartaleq commented 13 years ago

I had an unused diamond pickaxe and one that was just about to break in my inventory. I used the near-broken one until it did break. When it broke, both of the diamond pickaxes in my inventory perished. So, so sad. :(

smartaleq commented 13 years ago

Resolved, new toolchecker removes only one item slot at a time now.

error was caused due to using .remove(itemstack) which removes all matching itemstacks for QTY and MATERIAL but ignoring damage/data

RCarretta commented 13 years ago

I assume you just changed inv.remove() to inv.removeItem()?

smartaleq commented 13 years ago

no, that doesn't actually work. I had to get the contents and set qty to 0 for that stack then setContents. RemoveItem also doesn't see durability

RCarretta commented 13 years ago

it seems to work when i do it. on my branch (code running on server atm) that's the only change I made and it isn't having issues.