mirror of
https://github.com/Artillex-Studios/AxMinions.git
synced 2024-11-26 12:15:57 +01:00
Add prioritised registration
This commit is contained in:
parent
e59911f6b0
commit
102c4ec5a1
@ -1,6 +1,7 @@
|
|||||||
package com.artillexstudios.axminions.integrations;
|
package com.artillexstudios.axminions.integrations;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||||
|
import org.joml.Math;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -13,6 +14,10 @@ public abstract class Integration<T extends Integrable> {
|
|||||||
this.integrations.add(integration);
|
this.integrations.add(integration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void register(int priority, T integration) {
|
||||||
|
this.integrations.add(Math.clamp(0, integrations.size(), priority), integration);
|
||||||
|
}
|
||||||
|
|
||||||
public List<T> integrations() {
|
public List<T> integrations() {
|
||||||
return this.view;
|
return this.view;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user