// Path: src/main/java/org/cyclops/everlastingabilities/Reference.java
// @SuppressWarnings("javadoc")
// public class Reference {
// 	
//     // Mod info
//     public static final String MOD_ID = "everlastingabilities";
//     public static final String GA_TRACKING_ID = "UA-65307010-9";
//     public static final String VERSION_URL = "https://raw.githubusercontent.com/CyclopsMC/Versions/master/" + MinecraftHelpers.getMinecraftVersionMajorMinor() + "/EverlastingAbilities.txt";
//     
//     // Paths
//     public static final String TEXTURE_PATH_GUI = "textures/gui/";
//     public static final String TEXTURE_PATH_SKINS = "textures/skins/";
//     public static final String TEXTURE_PATH_MODELS = "textures/models/";
//     public static final String TEXTURE_PATH_ENTITIES = "textures/entities/";
//     public static final String TEXTURE_PATH_GUIBACKGROUNDS = "textures/gui/title/background/";
//     public static final String TEXTURE_PATH_ITEMS = "textures/items/";
//     public static final String TEXTURE_PATH_PARTICLES = "textures/particles/";
//     public static final String MODEL_PATH = "models/";
// 
// }
// 
// Path: src/main/java/org/cyclops/everlastingabilities/ability/config/AbilityStepAssistConfig.java
// public class AbilityStepAssistConfig extends AbilityConfig<AbilityTypeStepAssist> {
// 
//     @ConfigurableProperty(category = "ability", comment = "Forces the default step height value to 0.6 when this ability is deactivated.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static boolean forceDefaultStepHeight = true;
// 
//     @ConfigurableProperty(category = "ability", comment = "Rarity of this ability.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static int rarity = Rarity.COMMON.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 = 25;
// 
//     @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;
// 
//     @ConfigurableProperty(category = "ability", comment = "If this can be obtained by combining totems in a crafting grid.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static boolean obtainableOnCraft = true;
// 
//     @ConfigurableProperty(category = "ability", comment = "If this can be obtained in loot chests.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static boolean obtainableOnLoot = true;
// 
//     public AbilityStepAssistConfig() {
//         super("step_assist",
//                 eConfig -> new AbilityTypeStepAssist(eConfig.getNamedId(), () -> rarity, () -> maxLevel, () -> xpPerLevel,
//                         () -> obtainableOnPlayerSpawn, () -> obtainableOnMobSpawn, () -> obtainableOnCraft, () -> obtainableOnLoot));
//     }
// 
// }


import net.minecraft.entity.player.PlayerEntity;
import org.cyclops.everlastingabilities.Reference;
import org.cyclops.everlastingabilities.ability.config.AbilityStepAssistConfig;
import java.util.function.Supplier;
package org.cyclops.everlastingabilities.ability;



/**
 * Ability type for flight.
 * @author rubensworks
 */
public class AbilityTypeStepAssist extends AbilityTypeDefault {

    private static final String PLAYER_NBT_KEY = Reference.MOD_ID + ":" + "stepAssist";

    public AbilityTypeStepAssist(String id, Supplier<Integer> rarity, Supplier<Integer> maxLevel,
                                 Supplier<Integer> baseXpPerLevel, Supplier<Boolean> obtainableOnPlayerSpawn, Supplier<Boolean> obtainableOnMobSpawn,
                                 Supplier<Boolean> obtainableOnCraft, Supplier<Boolean> obtainableOnLoot) {
        super(id, rarity, maxLevel, baseXpPerLevel, obtainableOnPlayerSpawn, obtainableOnMobSpawn, obtainableOnCraft, obtainableOnLoot);
    }

    @Override
    public void onTick(PlayerEntity player, int level) {
        player.stepHeight = player.isCrouching() ? 0.5F : level;
    }

    @Override
    public void onChangedLevel(PlayerEntity player, int oldLevel, int newLevel) {
        if (oldLevel > 0 && newLevel == 0) {
            float stepHeight = 0.6F;
            if(player.getPersistentData().contains(PLAYER_NBT_KEY)) {
// Path: src/main/java/org/cyclops/everlastingabilities/Reference.java
// @SuppressWarnings("javadoc")
// public class Reference {
// 	
//     // Mod info
//     public static final String MOD_ID = "everlastingabilities";
//     public static final String GA_TRACKING_ID = "UA-65307010-9";
//     public static final String VERSION_URL = "https://raw.githubusercontent.com/CyclopsMC/Versions/master/" + MinecraftHelpers.getMinecraftVersionMajorMinor() + "/EverlastingAbilities.txt";
//     
//     // Paths
//     public static final String TEXTURE_PATH_GUI = "textures/gui/";
//     public static final String TEXTURE_PATH_SKINS = "textures/skins/";
//     public static final String TEXTURE_PATH_MODELS = "textures/models/";
//     public static final String TEXTURE_PATH_ENTITIES = "textures/entities/";
//     public static final String TEXTURE_PATH_GUIBACKGROUNDS = "textures/gui/title/background/";
//     public static final String TEXTURE_PATH_ITEMS = "textures/items/";
//     public static final String TEXTURE_PATH_PARTICLES = "textures/particles/";
//     public static final String MODEL_PATH = "models/";
// 
// }
// 
// Path: src/main/java/org/cyclops/everlastingabilities/ability/config/AbilityStepAssistConfig.java
// public class AbilityStepAssistConfig extends AbilityConfig<AbilityTypeStepAssist> {
// 
//     @ConfigurableProperty(category = "ability", comment = "Forces the default step height value to 0.6 when this ability is deactivated.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static boolean forceDefaultStepHeight = true;
// 
//     @ConfigurableProperty(category = "ability", comment = "Rarity of this ability.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static int rarity = Rarity.COMMON.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 = 25;
// 
//     @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;
// 
//     @ConfigurableProperty(category = "ability", comment = "If this can be obtained by combining totems in a crafting grid.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static boolean obtainableOnCraft = true;
// 
//     @ConfigurableProperty(category = "ability", comment = "If this can be obtained in loot chests.", isCommandable = true, configLocation = ModConfig.Type.SERVER)
//     public static boolean obtainableOnLoot = true;
// 
//     public AbilityStepAssistConfig() {
//         super("step_assist",
//                 eConfig -> new AbilityTypeStepAssist(eConfig.getNamedId(), () -> rarity, () -> maxLevel, () -> xpPerLevel,
//                         () -> obtainableOnPlayerSpawn, () -> obtainableOnMobSpawn, () -> obtainableOnCraft, () -> obtainableOnLoot));
//     }
// 
// }


// Path: src/main/java/org/cyclops/everlastingabilities/ability/AbilityTypeStepAssist.java
import net.minecraft.entity.player.PlayerEntity;
import org.cyclops.everlastingabilities.Reference;
import org.cyclops.everlastingabilities.ability.config.AbilityStepAssistConfig;
import java.util.function.Supplier;

package org.cyclops.everlastingabilities.ability;



/**
 * Ability type for flight.
 * @author rubensworks
 */
public class AbilityTypeStepAssist extends AbilityTypeDefault {

    private static final String PLAYER_NBT_KEY = Reference.MOD_ID + ":" + "stepAssist";

    public AbilityTypeStepAssist(String id, Supplier<Integer> rarity, Supplier<Integer> maxLevel,
                                 Supplier<Integer> baseXpPerLevel, Supplier<Boolean> obtainableOnPlayerSpawn, Supplier<Boolean> obtainableOnMobSpawn,
                                 Supplier<Boolean> obtainableOnCraft, Supplier<Boolean> obtainableOnLoot) {
        super(id, rarity, maxLevel, baseXpPerLevel, obtainableOnPlayerSpawn, obtainableOnMobSpawn, obtainableOnCraft, obtainableOnLoot);
    }

    @Override
    public void onTick(PlayerEntity player, int level) {
        player.stepHeight = player.isCrouching() ? 0.5F : level;
    }

    @Override
    public void onChangedLevel(PlayerEntity player, int oldLevel, int newLevel) {
        if (oldLevel > 0 && newLevel == 0) {
            float stepHeight = 0.6F;
            if(player.getPersistentData().contains(PLAYER_NBT_KEY)) {
                if (!AbilityStepAssistConfig.forceDefaultStepHeight) {