This repository was archived by the owner on Feb 1, 2026. It is now read-only.
Conversation
Reviewer's GuideThis PR restructures alias management by enhancing config handling, refactoring alias execution to support JSON arrays and variable substitution (including per-player custom variables), improving command registration logic, and updating the build for Quilt compatibility with a version bump. Sequence diagram for executing an alias with variable substitution and multiple commandssequenceDiagram
actor Player
participant ServerCommandSource
participant ExampleMod
participant CommandDispatcher
Player->>ServerCommandSource: Issues alias command
ServerCommandSource->>ExampleMod: executeAlias(alias, ctx)
ExampleMod->>ExampleMod: Parse alias value (JSON string/array)
loop For each command in alias
ExampleMod->>ExampleMod: substituteVariablesWithArgs(cmd, ctx, args)
ExampleMod->>CommandDispatcher: parse(substitutedCmd, source)
CommandDispatcher->>CommandDispatcher: execute(parsed)
end
ExampleMod->>ServerCommandSource: Return result
Sequence diagram for setting a per-player custom variable via /setcmdvariablesequenceDiagram
actor Player
participant ServerCommandSource
participant ExampleMod
Player->>ServerCommandSource: /setcmdvariable <variable> <value>
ServerCommandSource->>ExampleMod: registerSetCmdVariable()
ExampleMod->>ExampleMod: Store variable in playerVariables[uuid]
ExampleMod->>ServerCommandSource: Send feedback to player
Class diagram for updated ExampleMod alias and variable managementclassDiagram
class ExampleMod {
+MOD_ID : String
+LOGGER : Logger
-CONFIG_PATH : Path
-aliases : Map<String, String>
-playerVariables : Map<UUID, Map<String, String>>
+onInitialize()
-ensureConfigExists()
-registerAddCommand(CommandDispatcher)
-registerSetCmdVariable(CommandDispatcher)
-registerAliases(CommandDispatcher)
-registerAlias(CommandDispatcher, String, String)
-executeAlias(String, CommandContext)
-substituteVariablesWithArgs(String, CommandContext, String[])
-substituteVariables(String, CommandContext)
-loadAliases()
-saveAliases()
}
ExampleMod --> "*" Map
ExampleMod --> "*" Path
ExampleMod --> "*" UUID
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Consider extracting and reusing the duplicate logic in substituteVariablesWithArgs and substituteVariables into a single utility method to avoid code duplication.
- The playerVariables map is never cleared—consider removing entries on player logout to prevent unbounded memory growth over time.
- The header comments for the config file are duplicated in ensureConfigExists() and saveAliases(); extract them into a single constant to keep them in sync.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting and reusing the duplicate logic in substituteVariablesWithArgs and substituteVariables into a single utility method to avoid code duplication.
- The playerVariables map is never cleared—consider removing entries on player logout to prevent unbounded memory growth over time.
- The header comments for the config file are duplicated in ensureConfigExists() and saveAliases(); extract them into a single constant to keep them in sync.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Enhance command alias mod with robust config management, multi-command and dynamic variable support, and Quilt compatibility
New Features:
Enhancements:
Build: