Architectury API (UNUSED)

Architectury API (UNUSED)

9M Downloads

[Feature] Event priorities

MaxNeedsSnacks opened this issue ยท 0 comments

commented

With Fabric's events supporting "phases" and Forge having their priority enum, we could probably introduce a primitve event priority system to Architectury events as well.

This would most likely include just copying the Forge enum ourselves (HIGHEST - LOWEST in five steps in total), and then registering with corresponding event phases on Fabric to mimic these Architectury ones, which would then have to be ordered something like this:

event.addPhaseOrdering("architectury:highest", "architectury:high");
event.addPhaseOrdering("architectury:high", "fabric:default");
event.addPhaseOrdering("fabric:default", "architectury:low");
event.addPhaseOrdering("architectury:low", "architectury:lowest");

(Alternatively, we could throw an additional architectury:normal either before or after fabric:default, since our current priority on forge is HIGH we might want to do this?)

Registering to an Architectury event with a priority would function similarly to how Fabric does it, albeit using the priority enum mentioned above instead of arbitrary phase IDs, i.e. for instance event.register(HIGHEST, listener)

Because this would constitute a major new feature, I suggest we only add this system to the more recent versions of Arch, namely 1.19.2 and 1.20.1 (1.19.3 and 1.19.4 do not strike me as particularly worth maintaining atm)