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
- Fixed issue #105, where the config changes made in-game were not saving at all. Apologies in advance to everyone who was affected.
- The
1.20.4
version had wrong metadata infabric.mod.json
, regarding the support of1.20.3
yet again. I have now changed its supported Minecraft version back to>=1.20.3
, again.- Altho the
1.20.4
jar file will now accept being loaded in1.20.3
, I still do not know for sure if it actually works on1.20.3
. Here be dragons.
- Altho the
Given the changes and additions made in this release, it is highly recommended to read through this changelog before using this release.
Release v3.8
makes some changes to some exiting features, and adds a new server-sided feature called "stat announcement system". It also adds some new config properties that let the user control how this mod behaves.
The "betterstats" network protocol
This feature allows betterstats
clients and servers to communicate, which enables some extra features when this mod is present on a server. Some changes were made to this system;
- (Change 1) The protocol version has been changed to
2
. Was previously set to1
.- Note that both the client and the server must use the same protocol version for the server-sided features to work. If the client encounters a server with a different
betterstats
protocol version, the client will then treat the server as if it dosn't havebetterstats
installed, and vice-versa. - This was done because of the changes that were made to the protocol.
- Note that both the client and the server must use the same protocol version for the server-sided features to work. If the client encounters a server with a different
- (Change 2) After a client enables the
betterstats
connection with a server, they can no longer disable it until they disconnect. This change was done because it's pointless to disable the protocol once enabled, as the server still knows the client hasbetterstats
installed. - (Change 3) Next up, by default the client will now automatically always enable the
betterstats
protocol connection with the server, that is, when the client detectsbetterstats
on the server as well.- A config property called
client-trustAllServersBssNet
was added to control this behavior as well. - The first reason is so the user doesn't have to go to the "Statistics" menu to manually enable the connection each time they join a server.
- The second reason is because the "stat announcement system" recommends that the client have
betterstats
installed. If the client doesn't havebetterstats
, then all announed messages will appear in English and will not translate for that client. - The third reason is because of how Fabric API works. Previously, I made it so clients have to manually enable the connection every time they join a server, out of concern for privacy and the server finding out about the client being modded. However, it turns out Fabric API's registry synchronization system already likely exposes this information to the server anyways. So at that point, it's kinda pointless to have a manual toggle, as other mods and even Fabric itself may alreaydy be screaming to the server saying "I am a modded client".
- A config property called
The "stat announcement system"
(Always remember, this mod will never require being installed on the server. All server-sided features are optional)
The stat announcement system is a new optional server-sided feature whose purpose is to use the chat to announce players doing various unique things and achieving certain stats. As of v3.8
, the "SAS" only announces players doing certain things for their first time, however more features may be added to it in the future.
This system is also completely configurable, and may be disabled by those who don't like it or don't want it. The config properties are server-enableSAS
(Boolean) and server-sasConfig
(JsonObject).
This goal with SAS is to promote people's engagement with the game and their stats, as well as to let players acknowledge they've done something special. Well, unless you die in hardcore that is.. then the mod's gonna roast you;
The commands
- My personal library mod TCDCommons API's
/badges
command was moved over to this mod, so as to avoid registering features in my API mod. - Added a config property called
server-registerCommands
. It lets you control whether or not/statistics
and/badges
will be registered.
The player-badge system
Given the player badge system wasn't really all that useful or even used (at least, as far as I've noticed), I have decided to make it disabled by default. It may be re-enabled at any time using the tcdcommons
's config file. More info on that can be found in the v3.8
changelogs for tcdcommons
.
The mod configuration
For clarity and readability reasons, existing config properties were renamed, so it's easier to tell which one is for the client and which one is for the server. Note that server-sided config properties apply to singleplayer as well, and not just dedicated servers.
Config changes for this mod:
guiMobsFollowCursor
was renamed toclient-guiMobsFollowCursor
.- Added
client-trustAllServersBssNet
(Boolean) - Added
server-registerCommands
(Boolean) - Added
server-enableSAS
(Boolean) - Added
server-sasConfig
(JsonObject, aka the{}
JSON thingy)
Config changes for tcdcommons
:
- Renamed
enablePlayerBadges
toserver-enablePlayerBadges
- Renamed
broadcastEarningPlayerBadges
toserver-broadcastEarningPlayerBadges
- Renamed
enableHttpUtils
tocommon-enableHttpUtils
Now that looks a lot more readable. Because I mean.. prior to that, the config for both this mod and for tcdcommons
looked about as unreadable as this is:
To learn how to configure this mod, and tcdcommons
, here are the wiki pages I wrote:
Mod compatibility and crash fixes. Please refer to the changelogs on GitHub for more info on this release.
On another note, I just made a Google Form to collect feedback from the community. Feel free to share your rating and thoughts if you'd like to.