ShayBox / Durability101

A rewrite of the original Durability101 mod
https://curseforge.com/minecraft/mc-mods/durability101
MIT License
5 stars 5 forks source link

TConstruct ammo items mess the counter up #1

Closed Khioni closed 3 years ago

Khioni commented 5 years ago

image

For reference, the wood shortbow is just fine, showing proper durability.

Cross-posted to TiCon's end.

ShayBox commented 5 years ago

It seems tinkers items with ammo use the ammo count as the durability, but with an extra 0, so while the ammo is 108 total, the durability they use is 1080.

I assume there was a reason for it, maybe to have extra durability when the ammo reaches 0, but still be a nice number to work with, but as items don't break at 0 durability that may not be the case.

They could probably change this, but for me to fix it would be a mod specific workaround that checks if the item is from tinkers and has ammo, it wouldn't fix it for any other durability viewing mods, or change the actual durability of the item.

Open to implementing a workaround, but I want to see what the tinkers devs have to say, maybe they would be willing to change how durability is handled in their mod as it would produce a better result.

Khioni commented 5 years ago

Yeah, according to this line, they indeed do work the ammo counters out as "10 durability = 1 ammo".

Going by that, the workaround solution appears to be finding a way to detect the ammo items, then have it divide by 10, while truncating the decimal so it doesn't get fooled and round up, creating a fake 2 when it's actually still at 1.

P.S This mod is absolutely amazing! I used to have a durability viewer back when 1.8.X and 1.7.10 were the things, but afterwards, missed this exact type for so long.

After 1.8, we all had to either use that F3+H and get the IDs and everything that I have no use for, or install a different kind of durability viewer that requires you to mouse-over just as F3H always did.

Go keep this resurrection up, every player using mods, whether on an intense modpack with tons of content, or just casual minecraft with a few QoL mods, should use this!