Config Info

Resourceful Config in addition to the in-game screen has an optional web server users/server admins can turn on to edit configs from their browser. This allows for greater control of a server without having to manually edit configs.

You can define certain information about your config using the @ConfigInfo annotation. Additionally this annotation is also used for the in-game screen for title, description, and links.

Parameters

icon

The icon for this is an id to a lucide.dev icon with some extra ones we define, you can find the list of these by going to our website at https://config.teamresourceful.com/icons

Title

This is the name of the config, you usually want this to be the display name of your mod.

Title Translation

This like the title is the name of the config but is the translation key that will be used to try and localize.

Description

This like name usually wants to be something about your mod but if you do include several configs you can explain what the config is for.

Description Translation

This like the description is the purpose of the config but is the translation key that will be used to try and localize.

Links is a list of link annotations, these annotations consist of a value which is the url, an icon which is what will be displayed on the button, and the title which is what will be used for the tooltip of the button. The icon is the same as the icon of the whole config so check out our site for that too.

It will look like this:

@ConfigInfo.Link(value = "https://example.com", icon = "box", text = "Example Site", textTranslation = "example.site.translation")

Color

The color annotation is applied to a config is it mutually exclusive with the @Gradient annotation. It has 1 value which is a hashed hex color. This is used for the display of the config in the web config.

Gradient

Like the color annotation this is also applied to a config and is used for the display in the web config. The difference is that a gradient has 3 parameters with value being the degree of the gradient and then first and second being the 2 hashed hex colors to use for the gradient.

Provider

The @ConfigInfo.Provider is used if you want to use a more dynamic approach to providing the config info. This is useful if you need to duplicate the same thing on multiple configs. This takes a class which implements ResourcefulConfigInfo and has a public constructor that has either no parameters or 1 single string parameter which is the filename of the config or the id category.

Example

@ConfigInfo(
        title = "Demo",
        description = "Description for a demo.",
        icon = "planet",
        links = {
                @ConfigInfo.Link(text = "Link 1", value = "https://www.google.com", icon = "aperture"),
                @ConfigInfo.Link(text = "Link 2", value = "https://www.google.com", icon = "box")
        }
)

Last updated