- Renamed the
properties.json
resource file tobetterstats.properties.json
, so as to avoid any potential conflicts with external resources that might have the same name. - Updated the embedded
tcdcommons
API mod, featuring a very minor potential performance improvement with cache file handling.
- Fixed Issue Issue #113 that was causing crashes on devices with non-English systems.
A port to 24w09a
.
Requires and depends on Architectury API.
Uploaded just for fun. Just for the sake of it.
Note: The latest snapshot as of right now is 20w11a
. A proper 1.20.5
port will be released once 1.20.5
comes out.
This update fixed Issue #112, where the Failed to clean up cached files
error kept appearing in console. Apologies to everyone who was affected and had their consoles and logs flooded with error messages.
Additionally, I have made a resource pack that allows people to use this mod completely independently from Fabric API
. Given Fabric API
's resource loader is responsible for loading modded resources; If you do not have Fabric API
installed, you may instead download and apply the resource pack I made, effectively allowing you to use this mod properly without Fabric API
.
The resource pack file is called bss_rp-3.9.3+1.20.4.zip
, and can be downloaded by clicking here. It works on all 1.20.X
versions as well, so feel free to ignore any "incompatibility" warnings the game shows you.
Note to Windows users
Microsoft Windows Defender appears to be false-flagging the v3.9.2+fabric-1.20.1
file. This message is just a heads-up so you don't get scared if you encounter the "Trojan:Script/Wacatac.B!ml" detection. You may safely ignore it. For more info, visit Issue #111.
Update
The Microsoft Windows Defender issue has been resolved. If you still encounter issues, please visit Issue #111.
Performance update, plus some fixes and tweaks.
- Updated Russian translations thanks to Korben (#110).
- No longer depending on Fabric API (sort of).
- Turns out the whole "depending on Fabric API" thing was due to an error on my end this entire time. The error has been resolved.
- This fix is pointless however, as Fabric API is still responsible for loading modded textures and translation files.
- General stats now support the "group by" filter.
- Item stats and mob stats are now paginated.
So what's the performance update here?
Pagination. Let me explain;
Remember that one time you clicked on "Show empty stats" while playing with a massive mod-pack, only for this mod to display like all ~20k stats all at once, turning your PC into a DIY grill?
Yeah me neither. Well either way, that issue has now been resolved.
By dividing stats into multiple "pages", we are effectively preventing too many stats from showing up at once and lagging out the game.
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 asKilled: %s
%s killed you %s time(s)
is now shown asDied 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 isyeetinator: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
- 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
- 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
- The
Search
textbox on the filters panel now has a placeholder text that saysSearch...
. 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 readingfabric.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 information has been moved to a file called
The "performance fix" (for a lag spike)
Given how Minecraft now works, Item
s can now dynamically have their corresponding ItemGroup
s 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.
This update brings some new features, as well as changes to existing features.
Statistics tabs
- The
Monsters hunted
tab will now show all hostile mobs, regardless of whether or not said mobs are required for the advancement.- Technically it already did with modded mobs, but only hid some vanilla ones, so now no vanilla mobs will be hidden
- The initial goals with
Monsters hunted
andA balanced diet
tabs was (and to an extent still is), helping people get the two advancements. However, given criteria for said advancements can be changed by mods and data-packs and server-sided code, this mod cannot accurately tell what is and is not required. Therefore the two tabs have shifted towards displaying everything. As such, to avoid confusion:- The
Monsters hunted
tab was renamed toHostile creatures
- The
A balanced diet
tab was renamed toFood & drinks
- The
- The
Mobs
tab will no longer display "miscellaneous" entities such as "TNT" and "Llama spit", unless there are stats present for them - Mob stats will now show all modded entity
StatType
s. If aText
formatter for a modded entityStatType
is not registered with this mod's API, then this mod will display theStatType
's ID instead
Statistics HUD
- Pinned item HUD stats now support modded item
StatType
s - Pinned mob HUD stats now support modded entity
StatType
s - Added pinning general stats to the HUD. You can now right click general stats to pin them to the HUD
- Due to technical limitations however, those do not support updating in "real-time" for now. They instead update once every few seconds
MCBS files (Aka saving and loading stats files)
- When viewing stats read from another source such as a file, the player name in the corner will now appear white
- The
MCBS
file version has now been increased to4
. Was previously2
.- MCBS v4 files now support saving and loading of modded
StatType
s. - For backwards compatibility, this mod will continue to support loading MCBS v2 files.
- MCBS v4 files now support saving and loading of modded
- Implemented an error-handler for saving and loading of MCBS files. The game will no longer crash when attempting to load unsupported MCBS file versions
- Big massive warning:: Older versions of this mod do not have error handlers, and as such, will crash the game if you attempt to load MCBS v4 files with them. DO NOT attempt to open MCBS v4 files using older versions of this mod!
Other
- The "statistics summary" panel now supports modded
StatType
s tcdcommons
's cached resource manager will now periodically clean up expired cache files it created, so as to save disk space