Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TConstruct durability overflow #15599

Open
3 tasks done
TheAimless opened this issue Feb 26, 2024 · 10 comments
Open
3 tasks done

TConstruct durability overflow #15599

TheAimless opened this issue Feb 26, 2024 · 10 comments

Comments

@TheAimless
Copy link

TheAimless commented Feb 26, 2024

Your GTNH Discord Username

theaimless

Your Pack Version

2.5.0

Your Server

SP

Java Version

Java 17

Type of Server

None

Your Expectation

More material should return 100 durability.

The Reality

Fixing the tool with more material sometimes causes the tool to have lower resulting durability.
Screenshot 2024-02-26 053054
Screenshot 2024-02-26 053111

Your Proposal

Add an overflow check for Tinkers Tools.

Final Checklist

  • I have searched this issue tracker and there is nothing similar already. Posting on a closed issue saying the bug still exists will prompt us to investigate and reopen it once we confirm your report.
  • I can reproduce this problem consistently by follow the exact steps I described above, or this does not need reproducing, e.g. recipe loophole.
  • I have asked other people and they confirm they also have this problem by follow the exact steps I described above, or this does not need reproducing, e.g. recipe loophole.
@TheAimless TheAimless added Status: Triage Issue awaiting triage. Remove once this issue is processed Bug: Minor labels Feb 26, 2024
@Caedis
Copy link
Member

Caedis commented Feb 26, 2024

Can you run /iih or /mt hand and post a screenshot of the tool's NBT data?

@Caedis
Copy link
Member

Caedis commented Feb 26, 2024

or even better, use /mt hand and click the text to copy it to your clipboard and paste it here

@TheAimless
Copy link
Author

Here you go:
TConstruct:lumberaxe:66.withTag({InfiTool: {RenderExtra: 7, BaseDurability: 621, ExtraAttack: 1, BaseAttack: 2, ToolEXP: 910 as long, HarvestLevel: 0, RenderHead: 7, ModDurability: 0.0 as float, Shoddy: 1.0 as float, RenderHandle: 7, Accessory: 7, MiningSpeed: 456, ExtraBaneOfArthropods: 1, Unbreaking: 0, Damage: 413, HarvestLevel2: 0, BonusDurability: 0, TotalDurability: 621, MiningSpeed2: 456, Head: 7, Attack: 2, Handle: 7, Broken: 0 as byte, Extra: 7, RenderAccessory: 7, ToolLevel: 10, RepairCount: 114, ExtraRedstone: 9211, Modifiers: 5}, display: {Name: "§fNetherrack Lumber Axe"}})

@Lyfts
Copy link
Member

Lyfts commented Mar 2, 2024

I have done some testing and have only been able to reproduce this with Tinkers Gregworks installed. I'm unsure exactly why it happens but it might be ModTGregRepair and ModToolRepair clashing in some way.

Attached is an NEI bookmark containing a lumber axe that with TGregworks installed requires 3 netherrack to fully repair and adding a 4th or 5th netherrack lowers the durability.
Without TGregworks installed this requires 6 netherrack to fully repair which could be related to the issue.

bookmarks.zip

@Lyfts Lyfts added Mod: TinkersGregworks and removed Status: Triage Issue awaiting triage. Remove once this issue is processed labels Mar 2, 2024
@leumasme
Copy link
Contributor

leumasme commented Sep 6, 2024

I'm unsure exactly why it happens but it might be ModTGregRepair and ModToolRepair clashing in some way.

I looked into this a bit and agree to this conclusion. (Also: Confirming this is still present in current Nightly 2024-09-05)
Both Repair Modification handlers are registered into itemModifiers and processed after each other (ModToolRepair first)
This actually leads to tool repairing generally giving more durability than intended - Both Repair Modifier handlers run, calculate the durability to restore, and repair the tool.

In the calculateIfNecessary function, both Repair handlers make sure that no more than half of the repair value of the items would be wasted due to the tool not having that much missing durability.
Thus, if the ModToolRepair (which runs first) repairs the tool to near-full durability, the ModTGregRepair will not run, so the tool is only repaired by one of the two handlers which roughly halves the amount that the tool is repaired by.

The correct thing here would probably be to just disable the normal tinkers ModToolRepair. (ModTGregRepair seems to include some explicit support for repairing with GT materials? Not sure why this is required as ModToolRepair seems to be able to repair tools using GT materials fine by using TConstructRegistry.customMaterials)
Note that this bugfix would reduce the amount of durability restored by half, making Tinkers tool repairs twice as expensive, which may be a considerable balance change.

@Lyfts
Copy link
Member

Lyfts commented Sep 6, 2024

I'd say that bugfix is worth it despite the balance change, GTNH has been playing easy mode Tinker's for 3+ 8 years now.
If need be we can always add an easy mode repair in Tinker' proper.

@miaowwwwww
Copy link
Member

This troubled me since the very start. like 7 yrs ago. Would be great if we can fix it.

@Caedis
Copy link
Member

Caedis commented Jan 6, 2025

Hmm, looks like we use the upstream version of TGregworks due to their license
https://github.com/Vexatos/TinkersGregworks/tree/GT-NH

@Dream-Master
Copy link
Member

Hmm, looks like we use the upstream version of TGregworks due to their license https://github.com/Vexatos/TinkersGregworks/tree/GT-NH

Make a pr for upstream and vexatos make us a own version

@Caedis
Copy link
Member

Caedis commented Jan 6, 2025

yeah, i noticed that. Will do after some testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants