TheCSMods / mc-better-stats

A Minecraft (Fabric) mod that improves the statistics screen and makes it more useful.
https://modrinth.com/mod/n6PXGAoM
GNU Lesser General Public License v3.0
48 stars 19 forks source link

[Suggestion] Introduce support for `StatFormatter`s. #137

Open TheCSDev opened 1 month ago

TheCSDev commented 1 month ago

What is this suggestion for?

Mod Itself

Suggestion

Each Stat has its own StatFormatter that is assigned to it.
This concept of StatFormatters is primarily used for "general stats", but is actually applied to every StatType out there.

Better Statistics Screen, for every stat other than "general stats", makes an assumption that a given stat uses StatFormatter#DEFAULT, hence rendering the literal raw value of said stat. This works for pretty much every vanilla item and mob StatType out there so far, but some StatTypes, esespecially modded ones, may use a different StatFormatter, causing BSS to misrepresent its actual value.

One example of stats being misrepresented because of this, is the "More Stats" mod. Some of its stats likely use the StatFormatter#DIVIDE_BY_TEN formatter, causing BSS to misrepresent their values. This issue was countered by simply applying a "(x10)" label to the translation files, which isn't the ideal solution.

Likely related issues:

Code of Conduct

TheCSDev commented 4 weeks ago

Hello past me, future me here.
Thanks for the suggestion! I have gone ahead and implemented this. Although, this patch doesn't apply to pinned HUD stats yet. Will have to tweak that as well.

Edit: Not future me here. That was actually my present me, now past me, but more recent past me. Anyway, current present me out.