2018-11-12 01:29:33 +01:00
|
|
|
package de.ellpeck.naturesaura.api.aura.type;
|
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
2020-01-21 21:04:44 +01:00
|
|
|
import net.minecraft.world.IWorld;
|
2018-11-12 01:29:33 +01:00
|
|
|
|
|
|
|
public interface IAuraType {
|
|
|
|
|
2020-01-21 21:04:44 +01:00
|
|
|
static IAuraType forWorld(IWorld world) {
|
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())
|
2018-12-02 13:49:20 +01:00
|
|
|
if (type.isPresentInWorld(world) && type.getPriority() > highestType.getPriority())
|
|
|
|
highestType = type;
|
|
|
|
return highestType;
|
2018-11-12 01:29:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ResourceLocation getName();
|
|
|
|
|
2020-01-21 21:04:44 +01:00
|
|
|
boolean isPresentInWorld(IWorld world);
|
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
|
|
|
}
|