Skip to content

Introduce new messages config#1

Merged
Adammatthiesen merged 1 commit into
mainfrom
progress
Jun 26, 2026
Merged

Introduce new messages config#1
Adammatthiesen merged 1 commit into
mainfrom
progress

Conversation

@Adammatthiesen

Copy link
Copy Markdown
Member

This pull request introduces a new MessagesConfig configuration class to centralize all user-facing messages and error strings, replacing hardcoded messages throughout the codebase. This change increases maintainability and makes it easier to customize messages without modifying code. The update also refactors command logic to use these configurable messages and cleans up the previous approach of storing error messages in MainConfig.

Centralized Message Configuration

  • Added a new MessagesConfig class that holds all success and error messages, and integrated it into the configuration manager (CobbledLevelControlConfigManager). [1] [2] [3] [4] [5]
  • Removed the old errorMessages section from MainConfig, consolidating all message strings into the new config. [1] [2]

Command Logic Refactoring

  • Updated all command handlers in LevelControlCommand.java to use messages from MessagesConfig instead of hardcoded strings, improving consistency and enabling easier localization or customization. [1] [2] [3] [4] [5] [6]

Consistency and Bug Fixes

  • Standardized checks for unset difficulties to use RuntimeDifficulty.emptyDifficulty instead of the string "none", ensuring consistent logic throughout event listeners and commands. [1] [2] [3]

These changes make the codebase easier to maintain and extend, especially for users who want to customize in-game messages.

@Adammatthiesen Adammatthiesen marked this pull request as ready for review June 26, 2026 01:49
@Adammatthiesen Adammatthiesen merged commit defe6a7 into main Jun 26, 2026
1 check passed
@Adammatthiesen Adammatthiesen deleted the progress branch June 26, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant