Better Statistics Screen

Better Statistics Screen

Mod

A Minecraft mod that improves the statistics screen and makes it more useful.

Client or server Utility

1.33M downloads
1,380 followers
Created2 years ago
Updated17 days ago

Follow Save
Host your Minecraft server on BisectHosting - get 25% off your first month with code MODRINTH.

BSS (fabric-1.20.2) - v3.9.1

Changelog

This update primarily focuses on the mod's code structure and organization, but has some extra features and changes as well.
This update also resolves a pesky lag spike that kept taking place, and that went un-noticed by me.

Changes to features

  • The mod is now moving away from using vanilla Minecraft's way of formatting mob stat texts, and now uses texts that are more consistent with how item stat texts are handled. For example:
    • You killed %s %s is now shown as Killed: %s
    • %s killed you %s time(s) is now shown as Died to: %s
    • Additionally, support for More Stats's modded mob stats has been implemented (In around 19 languages however).
  • HUD stat widgets for items and mobs will now adjust their size to fit the "stat name" label.

Added features

  • Added the client-guiSmoothScroll config property
  • Added a "Send feedback" button in the bottom left corner.
    • Feel free to press that shiny yellow feedback button, as I'd love to get more feedback.
  • Added a feature that allows other mods to use lang/translation texts to implement support for their modded mob stats
    • Let's say you made a mod that lets people "yeet" mobs, and you added a stat that tracks how many times each mob was "yeeted", and let's say that StatType's ID is yeetinator:times_yeeted;
      • By default, this mod would have no way to know what text to use to display your mob stat, and so it would just display something along the lines of yeetinator:times_yeeted: 32.
      • You can then use your language file to define the "stat phrase" that this mod will use, using the betterstats.stattype_phrase.[stat_id_namespace].[stat_id_path] translation key syntax.
      • In this example, you'd define: "betterstats.stattype_phrase.yeetinator.times_yeeted": "Times yeeted"
      • And that's it. This mod now displays: Times yeeted: 32
  • The Search textbox on the filters panel now has a placeholder text that says Search.... This should tell the user more clearly that the black rectangle is in fact, a search textbox.

Technical changes

  • Mod contributor information, as well as mod links, are no longer stored in fabric.mod.json, so as to avoid depending on "platform-specific" code. Plus the Fabric Loader API for reading fabric.mod.json data isn't even as flexible as I wanted it to be.
    • The information has been moved to a file called properties.json, which can be found inside of the mod's .jar file.

The "performance fix" (for a lag spike)

Given how Minecraft now works, Items can now dynamically have their corresponding ItemGroups changed. In the past, each Item had a "set" ItemGroup that'd stay as-is forever. Now, items can change groups depending on the world settings.

Where a performance issue now came in is;

  • When you open a new world, items now need to be assigned to item groups depending on the world's settings.
  • This however, does not appear to take place during the "world loading" process (in 1.20.4 as far as I could observe), and this instead takes place when opening your inventory for the first time
  • When this process of assigning items to item groups takes place, the game then has to iterate all items in the game and assign them groups and stuff
  • In vanilla Minecraft, this isn't much of an issue, as the game can easily iterate around 1000 items it's got. But in modded environments, especially mod-packs, where there can be 10s of thousands of items.. Yea, the game can hang for quite a while.
  • So hopefully you can imagine how a lag spike taking place when opening your inventory can be annoying

How did I resolve the issue?

By making the process of assigning item groups to items take place right after the world loading process, rather than when opening inventory.

Why did I tackle a performance issue in this QOL GUI mod?

Because it was affecting this mod as well actually.
As you may have noticed, this mod's "Item stats" tab shows items grouped into item groups. For this to happen however, the game needs to have already arranged the items into groups.
And so what I did in the past is, I made the game do that process whenever the betterstats screen is opened, not realizing this causes lag spikes on large mod-packs.
As such, I have decided that it's best to just make the game do the whole process as the world is loading, rather than making the user sit thru lag spikes during gameplay.

Files

betterstats-3.9.1+fabric-1.20.2.jar(1.01 MiB) Primary Download

External resources



Project members

TheCSDev

Owner


Technical information

License
LGPL-3.0-only
Client side
optional
Server side
optional
Project ID