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

Bugfix: add durability to armors #2041

Merged
merged 2 commits into from
May 3, 2024

Conversation

Sleepy-Horse
Copy link

Before:
image
After:
image

@GizmoTheMoonPig
Copy link
Member

dammit, I knew I forgot those. Once I confirm the values match the old ones i'll pull this

Copy link
Member

@GizmoTheMoonPig GizmoTheMoonPig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

values look good! I assume using the armor material directly (using MATERIAL.getDurability) doesnt work? I dont know what the registry ordering is for the armor materials so it may not work

@Sleepy-Horse Sleepy-Horse marked this pull request as draft May 2, 2024 05:51
@Sleepy-Horse Sleepy-Horse marked this pull request as ready for review May 2, 2024 14:22
@Sleepy-Horse
Copy link
Author

Sleepy-Horse commented May 2, 2024

I couldn't find MATERIAL.getDurability; moreover, I couldn't find any code containing these constants. Could you please send a link to it if it exists?

@GizmoTheMoonPig
Copy link
Member

GizmoTheMoonPig commented May 2, 2024

According to neoforged/NeoForge#910, armor materials fire after items, meaning it wont currently work. Once that PR is pulled, you can use the armor material instead of hardcoding the numbers (TFArmorMaterials.FIERY.get().getDurability(25)). The numbers youll need to use for the multiplier are as follows:
Naga - 21
Ironwood - 20
Fiery - 25
Steeleaf - 10
Knightmetal - 20
Phantom - 30
Yeti - 20
Arctic - 10

@Sleepy-Horse
Copy link
Author

It is still hardcoded like in vanilla. I believe ArmorMaterial doesn't contain durability values (unlike tool Tier). My suggestions to avoid hardcoding it in every piece of armor are:

  • Create enum of durabilities for each ArmorMaterial
  • Create a TFArmorMaterial, which has durability

@GizmoTheMoonPig
Copy link
Member

alright, I had things mixed up now that I actually can look at the code (this is the first day all week that ive been able to sit down and actually do stuff). What you did here works for me. Sorry about the confusion!

@GizmoTheMoonPig GizmoTheMoonPig merged commit 194832d into TeamTwilight:1.20.x May 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants