neoforged / Bus

Event firing and listening framework, based on the event bus concept

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make event priority use an int value instead of a list of enum values

GizmoTheMoonPig opened this issue · comments

Hi!
I've been discussing event priorities with someone over on the Twilight Forest Discord server as they wanted to change the priority of our death event so their mod would properly work. While doing this, we had the realization that only having 5 different priorities that had no sorting order (at least I don't think it does?) is a rather flawed system.

My proposal: take a page out of how Mixin does it and allow people to specify an int for the priority. The default could just be 0, and mods that need a lower priority could just specify a negative number if needed. Mods could then be sorted based on this priority (perhaps by the actual mod loading order if multiple mods use the same value) and it would allow for finer control of when things fire.