English
English
Appearance
English
English
Appearance
The ItemWeightsConfigClient
class is responsible for managing the client-side configuration for the MT Inventory Weight mod. It handles the display settings for the weight HUD, such as its position on the screen and custom offsets.
The following settings are managed by the inventory_weights_client.json
file, which is automatically created and maintained by the mod in the config/inventoryweight
directory:
"BOTTOM_RIGHT"
.0.5f
.0.5f
.The ItemWeightsConfigClient
class provides two main methods to handle loading and saving the configuration:
loadConfig()
:
inventory_weights_client.json
file.hudPosition
, xOffset
, and yOffset
values based on the data found.saveConfig()
:
hudPosition
, xOffset
, and yOffset
into the inventory_weights_client.json
file.When the config file is created, it will look something like this:
{
"hudPosition": "BOTTOM_RIGHT",
"xOffset": 0.5,
"yOffset": 0.5
}
The hudPosition
option can be customized to several predefined positions, or you can set it to "CUSTOM"
for manual adjustment. The xOffset
and yOffset
values are only used when the HUD is set to the "CUSTOM"
position, allowing players to place the weight HUD anywhere on their screen.
The mod also includes basic error handling for loading and saving the config file:
IOException
occurs while reading or writing, the exception is printed to the console for debugging purposes.If you want to manually adjust the HUD position to the top left of the screen, you would modify the config file as follows:
{
"hudPosition": "CUSTOM",
"xOffset": 0.0,
"yOffset": 0.0
}
This flexibility allows players to tailor the HUD to fit their specific screen layout preferences.