Blood Magic

Blood Magic

90M Downloads

Bound tools don't respect setHarvestLevel

bonii-xx opened this issue ยท 5 comments

commented

https://github.com/WayofTime/BloodMagic/blob/master/src/main/java/WayofTime/alchemicalWizardry/common/items/BoundPickaxe.java#L336

Harvest Levels are hardcoded, Iguana Tinker Tweaks kinda needs that. ;)
Didn't look at axe and shovel, but my logs indicate that they don't support it either.

commented

Solved via #463

commented

As far as I can see from that piece of code it makes tools useless if not activated. So it isn't equivalent to simple setHarvestLevel("pickaxe", 5).
If it were to respect setHarvestLevel() calls it'd return super.getHarvestLevel("pickaxe") instead of 5, I think.

commented

Or the pickaxe could set it's harvest level to ("pickaxe", 5) by default, and in the getHarvestLevel method, return (getActivated(stack) && "pickaxe".equals(toolClass)) ? harvestLevel : 0;

That way, you're still checking whether or not the pick is even activated, and if it is, use the harvest level, otherwise it's still 0, same as today.

commented

what is the correct way to do that? lookup the tool in the tool registry in forge and return the result?

commented

I'm not even sure why it's overloaded, since it seems to do exactly the same as if you'd do a simple setHarvestLevel("pickaxe", 5) in the constructor.