{{ message }}
Feature: Mutable module priority - #220
Merged
Merged
Conversation
… listener sorting
emyfops
suggested changes
Jan 12, 2026
emyfops
left a comment
Contributor
There was a problem hiding this comment.
We will need to discuss to find another solution. This feels extremely hacky and does not seem fine for the long run. We can't just add hacks on top of the existing event system. I hate to be that person but I would much rather ship features at low rate than merging lots of hacks.
Member
Author
# Conflicts: # src/main/kotlin/com/lambda/module/Module.kt # src/main/kotlin/com/lambda/module/modules/combat/KillAura.kt # src/main/kotlin/com/lambda/module/modules/player/ClickFriend.kt
# Conflicts: # src/main/kotlin/com/lambda/config/AutomationConfig.kt # src/main/kotlin/com/lambda/gui/components/SettingsWidget.kt # src/main/kotlin/com/lambda/interaction/managers/Manager.kt # src/main/kotlin/com/lambda/interaction/managers/PostActionHandler.kt # src/main/kotlin/com/lambda/interaction/managers/breaking/BreakManager.kt # src/main/kotlin/com/lambda/interaction/managers/breaking/BrokenBlockHandler.kt # src/main/kotlin/com/lambda/interaction/managers/breaking/RebreakHandler.kt # src/main/kotlin/com/lambda/interaction/managers/hotbar/HotbarManager.kt # src/main/kotlin/com/lambda/interaction/managers/interacting/InteractManager.kt # src/main/kotlin/com/lambda/interaction/managers/interacting/InteractedBlockHandler.kt # src/main/kotlin/com/lambda/interaction/managers/inventory/InventoryManager.kt # src/main/kotlin/com/lambda/interaction/managers/rotating/RotationManager.kt # src/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt # src/main/kotlin/com/lambda/module/modules/player/RotationLock.kt
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Makes the priority field in listeners an updatableLazy so that modules can adjust their priority and update the sorting within the listener collections.
A modules priority, if being set (which is only necessary if it might conflict with other modules), should be set at the beginning of the init block. This is just as a default and can be changed by the user in-game.
The listener collections are updated by removing the owners listeners, updating their priority, and adding them back again. This minimizes cost, and resorting only occurs when the user changes a module priority