Closed MakerTim closed 8 years ago
Appreciate the contribution; this is something that existed in previous versions of the mod and should definitely be added back in. However, I would definitely prefer not having the strings hard-coded in this mod, and instead try to get them from the other mods if possible.
For Tinkers' Construct, this could be done using reflection to call HarvestLevels.getHarvestLevelName. Looks like the existing code should work with a slight modification ("tconstruct.library.util.HarvestLevels"
changed to "slimeknights.tconstruct.library.utils.HarvestLevels"
)
Assuming TiC's harvest level implementation is robust and TAIGA uses it in a compatible way, then that might also make it compatible with TAIGA as well.
I will look in to that now
To be more specific, I think these changes might be all you need:
In TooltipHandler.tooltipEvent, do something like:
int level = ((ItemTool) item).getToolMaterial().getHarvestLevel();
String name = StringHelper.getHarvestLevelName(level);
event.getToolTip().add(I18n.format("wailaharvestability.harvestlevel") + name);
and then change this line of StringHelper to:
HarvestLevels = Class.forName("slimeknights.tconstruct.library.utils.HarvestLevels");
Well, you were right ;)
Nice, will give more feedback once I get a chance to test it.
Thanks! :+1:
So, many of my modpack users are requesting this, because i use the mod TAIGA and numbers for harvesting stuff are not that helpful I'm not in any way a forge modder, but looked into your code and made a small add on so it can use multiple mods for multiple harvest levels
I KNOW it's not the best / nicest way of doing this, but it will not break in updates and doesn't need additional API's
So i choose for this way of adding names, all responsibility at this mod side and made this easy addon. It's probably not the final way of handeling this. but at least a temporary fix now
I'm all open for feedback in any way