Skip to content

Support categories/sections in generic.toml for better organization #40

@Th0rgal

Description

@Th0rgal

Problem

The `generic.toml` file contains 27+ checks in a flat list with no organizational structure. As users add custom checks, it becomes hard to navigate and maintain. A user reported that they tried adding category separators but it crashed the plugin (likely because the parser treats every top-level key as a check).

Root cause: `ConfigsManager.loadGenericChecks()` iterates all top-level TOML keys and tries to parse each one as a `GenericCheck`. There's no way to add organizational metadata without it being parsed as a check.

Suggested approach

Add an optional `category` field to each check entry:

[labymod_v1]
actions = ["alert"]
channels = ["LABYMOD"]
name = "Labymod v1"
category = "clients"

[forge]
actions = ["alert"]
channels = ["MC|Brand", "minecraft:brand"]
message_has = "forge"
name = "Forge"
category = "loaders"

[my_custom_check]
actions = ["alert"]
channels = ["custom:channel"]
name = "My Custom Check"
category = "custom"

Changes needed:

  1. Add a `category` field to `GenericCheck.java` (default to `"other"` if not specified)
  2. Parse the field in `ConfigsManager.loadGenericChecks()`
  3. Optionally group checks by category in the `/hs inv` and `/hs check` output

This is backward-compatible: existing configs without `category` fields will still work.

Relevant files

  • `hackedserver-core/src/main/resources/generic.toml`
  • `hackedserver-core/src/main/java/org/hackedserver/core/config/GenericCheck.java`
  • `hackedserver-core/src/main/java/org/hackedserver/core/config/ConfigsManager.java`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions