Doesn't support NBT data (Attributes)
Lovyxia opened this issue ยท 3 comments
The armor value shown is wrong when using attributes on armor / offhand / mainhand items, making this plugin much less useful outside of normal survival gameplay.
Also here's a small suggestion: I'd like to be able to move the armor bar, to keep it in line with my other GUI mods.
The vanilla armor bar doesn't support attributes either AFAIK. How do you suggest the extra (or missing) icons would be displayed?
I am planning on introducing support for my other mod Better HUD when its API has been cleaned up, which would satisfy your second suggestion.
The vanilla armor does represent armor points through custom attributes, even if you assign them to items in the main/offhand.
The best solution would be to check for attributes and represent them in the style of the armor that has them. If you were to wear purple leather boots with +3 armor that the mod would recognize this and show all 3 points in the purple leather style.
Items in the hand slots could show the vanilla armor icons, or maybe in a specific style that gives a more "temporary" feel.
The biggest issue would be decimal armor values. I think those could be done by showing which kind of armor has the biggest portion of 1 point. 0.25 leather, 0.25 iron and 0.5 diamond could show as 1 point of diamond armor, for example.
You're right, after looking around some more the vanilla bar uses attributes. I have rewritten the calculations so attributes are taken into account, it seems to work well. I have rounded partial points down for the moment (this is how vanilla rounds the whole bar), so any partial points get given to the next piece. I may change this later.