2424import java .util .Map ;
2525import java .util .Objects ;
2626import java .util .function .Function ;
27+
28+ import net .minecraft .resources .Identifier ;
29+
2730import net .fabricmc .fabric .api .event .Event ;
2831import net .fabricmc .fabric .impl .base .toposort .NodeSorting ;
29- import net .minecraft .resources .ResourceLocation ;
3032
3133class ArrayBackedEvent <T > extends Event <T > {
3234 private final Function <T [], T > invokerFactory ;
@@ -35,7 +37,7 @@ class ArrayBackedEvent<T> extends Event<T> {
3537 /**
3638 * Registered event phases.
3739 */
38- private final Map <ResourceLocation , EventPhaseData <T >> phases = new LinkedHashMap <>();
40+ private final Map <Identifier , EventPhaseData <T >> phases = new LinkedHashMap <>();
3941 /**
4042 * Phases sorted in the correct dependency order.
4143 */
@@ -58,7 +60,7 @@ public void register(T listener) {
5860 }
5961
6062 @ Override
61- public void register (ResourceLocation phaseIdentifier , T listener ) {
63+ public void register (Identifier phaseIdentifier , T listener ) {
6264 Objects .requireNonNull (phaseIdentifier , "Tried to register a listener for a null phase!" );
6365 Objects .requireNonNull (listener , "Tried to register a null listener!" );
6466
@@ -68,7 +70,7 @@ public void register(ResourceLocation phaseIdentifier, T listener) {
6870 }
6971 }
7072
71- private EventPhaseData <T > getOrCreatePhase (ResourceLocation id , boolean sortIfCreate ) {
73+ private EventPhaseData <T > getOrCreatePhase (Identifier id , boolean sortIfCreate ) {
7274 EventPhaseData <T > phase = phases .get (id );
7375
7476 if (phase == null ) {
@@ -108,7 +110,7 @@ private void rebuildInvoker(int newLength) {
108110 }
109111
110112 @ Override
111- public void addPhaseOrdering (ResourceLocation firstPhase , ResourceLocation secondPhase ) {
113+ public void addPhaseOrdering (Identifier firstPhase , Identifier secondPhase ) {
112114 Objects .requireNonNull (firstPhase , "Tried to add an ordering for a null phase." );
113115 Objects .requireNonNull (secondPhase , "Tried to add an ordering for a null phase." );
114116 if (firstPhase .equals (secondPhase )) throw new IllegalArgumentException ("Tried to add a phase that depends on itself." );
0 commit comments