// Path: src/main/java/org/cyclops/everlastingabilities/ability/AbilityTypePotionEffectSelf.java
// public class AbilityTypePotionEffectSelf extends AbilityTypeDefault {
// 
//     private static final int TICK_MODULUS = MinecraftHelpers.SECOND_IN_TICKS / 2;
// 
//     private final Effect potion;
// 
//     public AbilityTypePotionEffectSelf(String id, Supplier<Integer> rarity, Supplier<Integer> maxLevel,
//                                        Supplier<Integer> baseXpPerLevel, Supplier<Boolean> obtainableOnPlayerSpawn, Supplier<Boolean> obtainableOnMobSpawn,
//                                        Supplier<Boolean> obtainableOnCraft, Supplier<Boolean> obtainableOnLoot, Effect potion) {
//         super(id, rarity, maxLevel, baseXpPerLevel, obtainableOnPlayerSpawn, obtainableOnMobSpawn, obtainableOnCraft, obtainableOnLoot);
//         this.potion = potion;
//         if (this.potion == null) {
//             EverlastingAbilities.clog(Level.WARN, "Tried to register a null potion for ability " + id + ". This is possibly caused by a mod forcefully removing the potion effect for this ability.");
//         }
//     }
// 
//     protected int getDuration(int tickModulus, int level) {
//         return tickModulus * 5;
//     }
// 
//     protected int getTickModulus(int level) {
//         return TICK_MODULUS;
//     }
// 
//     protected int getAmplifier(int level) {
//         return level - 1;
//     }
// 
//     @Override
//     public void onTick(PlayerEntity player, int level) {
//         if (potion != null && player.world.getGameTime() % getTickModulus(level) == 0) {
//             player.addPotionEffect(
//                     new EffectInstance(potion, getDuration(getTickModulus(level), level), getAmplifier(level), true, GeneralConfig.showPotionEffectParticles));
//         }
//     }
// }
// 
// Path: src/main/java/org/cyclops/everlastingabilities/core/config/extendedconfig/AbilityConfig.java
// public abstract class AbilityConfig<T> extends ExtendedConfigForge<AbilityConfig<T>, IAbilityType> {
// 
//     public AbilityConfig(String namedId, Function<AbilityConfig<T>, ? extends IAbilityType> elementConstructor) {
//         super(EverlastingAbilities._instance, namedId, elementConstructor);
//     }
//     
//     @Override
// 	public String getTranslationKey() {
// 		return "ability." + getNamedId();
// 	}
// 
//     @Override
//     public String getFullTranslationKey() {
//         return "ability.abilities." + getMod().getModId()  + "." +getNamedId() + ".name";
//     }
// 
//     @Override
//     public ConfigurableType getConfigurableType() {
//         return ExtendedConfigurableType.ABILITY;
//     }
// 
//     @Override
//     public IForgeRegistry<? super IAbilityType> getRegistry() {
//         return AbilityTypes.REGISTRY;
//     }
// }


import net.minecraft.item.Rarity;
import net.minecraft.potion.Effects;
import net.minecraftforge.fml.config.ModConfig;
import org.cyclops.cyclopscore.config.ConfigurableProperty;
import org.cyclops.everlastingabilities.ability.AbilityTypePotionEffectSelf;
import org.cyclops.everlastingabilities.core.config.extendedconfig.AbilityConfig;
package org.cyclops.everlastingabilities.ability.config;


/**
 * Config for an ability.
 * @author rubensworks
 *
 */
public class AbilityResistanceConfig extends AbilityConfig<AbilityTypePotionEffectSelf> {

    @ConfigurableProperty(category = "ability", comment = "Rarity of this ability.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static int rarity = Rarity.RARE.ordinal();

    @ConfigurableProperty(category = "ability", comment = "The maximum ability level.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static int maxLevel = 3;

    @ConfigurableProperty(category = "ability", comment = "The xp required per level.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static int xpPerLevel = 50;

    @ConfigurableProperty(category = "ability", comment = "If this can be obtained by initially spawning players.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static boolean obtainableOnPlayerSpawn = true;

    @ConfigurableProperty(category = "ability", comment = "If this can be obtained by spawning mobs.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
// Path: src/main/java/org/cyclops/everlastingabilities/ability/AbilityTypePotionEffectSelf.java
// public class AbilityTypePotionEffectSelf extends AbilityTypeDefault {
// 
//     private static final int TICK_MODULUS = MinecraftHelpers.SECOND_IN_TICKS / 2;
// 
//     private final Effect potion;
// 
//     public AbilityTypePotionEffectSelf(String id, Supplier<Integer> rarity, Supplier<Integer> maxLevel,
//                                        Supplier<Integer> baseXpPerLevel, Supplier<Boolean> obtainableOnPlayerSpawn, Supplier<Boolean> obtainableOnMobSpawn,
//                                        Supplier<Boolean> obtainableOnCraft, Supplier<Boolean> obtainableOnLoot, Effect potion) {
//         super(id, rarity, maxLevel, baseXpPerLevel, obtainableOnPlayerSpawn, obtainableOnMobSpawn, obtainableOnCraft, obtainableOnLoot);
//         this.potion = potion;
//         if (this.potion == null) {
//             EverlastingAbilities.clog(Level.WARN, "Tried to register a null potion for ability " + id + ". This is possibly caused by a mod forcefully removing the potion effect for this ability.");
//         }
//     }
// 
//     protected int getDuration(int tickModulus, int level) {
//         return tickModulus * 5;
//     }
// 
//     protected int getTickModulus(int level) {
//         return TICK_MODULUS;
//     }
// 
//     protected int getAmplifier(int level) {
//         return level - 1;
//     }
// 
//     @Override
//     public void onTick(PlayerEntity player, int level) {
//         if (potion != null && player.world.getGameTime() % getTickModulus(level) == 0) {
//             player.addPotionEffect(
//                     new EffectInstance(potion, getDuration(getTickModulus(level), level), getAmplifier(level), true, GeneralConfig.showPotionEffectParticles));
//         }
//     }
// }
// 
// Path: src/main/java/org/cyclops/everlastingabilities/core/config/extendedconfig/AbilityConfig.java
// public abstract class AbilityConfig<T> extends ExtendedConfigForge<AbilityConfig<T>, IAbilityType> {
// 
//     public AbilityConfig(String namedId, Function<AbilityConfig<T>, ? extends IAbilityType> elementConstructor) {
//         super(EverlastingAbilities._instance, namedId, elementConstructor);
//     }
//     
//     @Override
// 	public String getTranslationKey() {
// 		return "ability." + getNamedId();
// 	}
// 
//     @Override
//     public String getFullTranslationKey() {
//         return "ability.abilities." + getMod().getModId()  + "." +getNamedId() + ".name";
//     }
// 
//     @Override
//     public ConfigurableType getConfigurableType() {
//         return ExtendedConfigurableType.ABILITY;
//     }
// 
//     @Override
//     public IForgeRegistry<? super IAbilityType> getRegistry() {
//         return AbilityTypes.REGISTRY;
//     }
// }


// Path: src/main/java/org/cyclops/everlastingabilities/ability/config/AbilityResistanceConfig.java
import net.minecraft.item.Rarity;
import net.minecraft.potion.Effects;
import net.minecraftforge.fml.config.ModConfig;
import org.cyclops.cyclopscore.config.ConfigurableProperty;
import org.cyclops.everlastingabilities.ability.AbilityTypePotionEffectSelf;
import org.cyclops.everlastingabilities.core.config.extendedconfig.AbilityConfig;

package org.cyclops.everlastingabilities.ability.config;


/**
 * Config for an ability.
 * @author rubensworks
 *
 */
public class AbilityResistanceConfig extends AbilityConfig<AbilityTypePotionEffectSelf> {

    @ConfigurableProperty(category = "ability", comment = "Rarity of this ability.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static int rarity = Rarity.RARE.ordinal();

    @ConfigurableProperty(category = "ability", comment = "The maximum ability level.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static int maxLevel = 3;

    @ConfigurableProperty(category = "ability", comment = "The xp required per level.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static int xpPerLevel = 50;

    @ConfigurableProperty(category = "ability", comment = "If this can be obtained by initially spawning players.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static boolean obtainableOnPlayerSpawn = true;

    @ConfigurableProperty(category = "ability", comment = "If this can be obtained by spawning mobs.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
    public static boolean obtainableOnMobSpawn = true;