2018-11-12 01:29:33 +01:00
|
|
|
package de.ellpeck.naturesaura.api.aura.type;
|
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
2021-12-04 15:40:09 +01:00
|
|
|
import net.minecraft.resources.ResourceLocation;
|
|
|
|
import net.minecraft.world.level.Level;
|
2018-11-12 01:29:33 +01:00
|
|
|
|
|
|
|
public interface IAuraType {
|
|
|
|
|
2021-12-04 15:40:09 +01:00
|
|
|
static IAuraType forLevel(Level level) {
|
2018-12-02 13:49:20 +01:00
|
|
|
IAuraType highestType = NaturesAuraAPI.TYPE_OTHER;
|
2018-11-12 01:29:33 +01:00
|
|
|
for (IAuraType type : NaturesAuraAPI.AURA_TYPES.values())
|
2021-12-04 15:40:09 +01:00
|
|
|
if (type.isPresentInLevel(level) && type.getPriority() > highestType.getPriority())
|
2018-12-02 13:49:20 +01:00
|
|
|
highestType = type;
|
|
|
|
return highestType;
|
2018-11-12 01:29:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ResourceLocation getName();
|
|
|
|
|
2021-12-04 15:40:09 +01:00
|
|
|
boolean isPresentInLevel(Level level);
|
2018-11-12 01:29:33 +01:00
|
|
|
|
2018-11-12 01:35:02 +01:00
|
|
|
int getColor();
|
2018-12-02 13:49:20 +01:00
|
|
|
|
|
|
|
int getPriority();
|
2019-02-16 21:31:37 +01:00
|
|
|
|
|
|
|
default boolean isSimilar(IAuraType type) {
|
|
|
|
return this == type;
|
|
|
|
}
|
2018-11-12 01:29:33 +01:00
|
|
|
}
|