<commit_before>package io.github.thatsmusic99.headsplus.config.customheads;

import io.github.thatsmusic99.headsplus.HeadsPlus;
import io.github.thatsmusic99.headsplus.config.ConfigHeads;
import io.github.thatsmusic99.headsplus.config.ConfigHeadsSelector;
import io.github.thatsmusic99.headsplus.config.HPConfig;
import io.github.thatsmusic99.headsplus.config.MainConfig;

import java.io.File;
import java.io.IOException;

@Deprecated
public class ConfigCustomHeads extends HPConfig {

    public static ConfigCustomHeads instance;

    public ConfigCustomHeads() {
        super("customheads.yml");
        instance = this;
    }

    @Override
    public void loadDefaults() {
        makeSectionLenient("heads");
        makeSectionLenient("sections");
        makeSectionLenient("options");
    }

    @Override
    public void moveToNew() {

        moveTo("options.update-heads", "update-heads", ConfigHeads.get());
        moveTo("options.version", "version", ConfigHeads.get());
        moveTo("options.default-price", "default-selector-head-price", MainConfig.get());
        moveTo("options.price-per-world", "per-world-prices", MainConfig.get());
        // For each head
        if (contains("heads")) {
            for (String key : getConfigSection("heads").getKeys(false)) {
                moveTo("heads." + key + ".displayname", "heads." + key + ".display-name", ConfigHeads.get());
                moveTo("heads." + key + ".texture", "heads." + key + ".texture", ConfigHeads.get());
                if (get("heads." + key + ".price") instanceof Double) {
                    moveTo("heads." + key + ".price", "heads.HP#" + key + ".price", ConfigHeadsSelector.get());
                }
                moveTo("heads." + key + ".section", "heads.HP#" + key + ".section", ConfigHeadsSelector.get());
            }
        }

        // For each section
        if (contains("sections")) {
            for (String key : getConfigSection("sections").getKeys(false)) {
                moveTo("sections." + key + ".texture", "sections." + key + ".texture", ConfigHeadsSelector.get());
                moveTo("sections." + key + ".display-name", "sections." + key + ".display-name", ConfigHeadsSelector.get());
                ConfigHeadsSelector.get().addDefault("sections." + key + ".enabled", true);
                ConfigHeadsSelector.get().addDefault("sections." + key + ".permission", "headsplus.section." + key);
            }
        }
    }

    @Override
    public void save() throws IOException {
        File customHeads = new File(HeadsPlus.get().getDataFolder(), "customheads.yml");
        if (!customHeads.exists()) return;
        if (!customHeads.renameTo(new File(HeadsPlus.get().getDataFolder(), "customheads-backup.yml"))) {
            HeadsPlus.get().getLogger().warning("Failed to rename customheads.yml to customheads-backup.yml name! You will need to do this yourself.");
        }
    }

    public static ConfigCustomHeads get() {
        return instance;
    }

}
<commit_msg>Added TODO to check customheads.yml<commit_after>package io.github.thatsmusic99.headsplus.config.customheads;

import io.github.thatsmusic99.headsplus.HeadsPlus;
import io.github.thatsmusic99.headsplus.config.ConfigHeads;
import io.github.thatsmusic99.headsplus.config.ConfigHeadsSelector;
import io.github.thatsmusic99.headsplus.config.HPConfig;
import io.github.thatsmusic99.headsplus.config.MainConfig;

import java.io.File;
import java.io.IOException;

@Deprecated
public class ConfigCustomHeads extends HPConfig {

    public static ConfigCustomHeads instance;

    public ConfigCustomHeads() {
        super("customheads.yml");
        instance = this;
    }

    @Override
    public void loadDefaults() {
        makeSectionLenient("heads");
        makeSectionLenient("sections");
        makeSectionLenient("options");
    }

    @Override
    public void moveToNew() {
        // TODO - this is broken, investigate
        moveTo("options.update-heads", "update-heads", ConfigHeads.get());
        moveTo("options.version", "version", ConfigHeads.get());
        moveTo("options.default-price", "default-selector-head-price", MainConfig.get());
        moveTo("options.price-per-world", "per-world-prices", MainConfig.get());
        // For each head
        if (contains("heads")) {
            for (String key : getConfigSection("heads").getKeys(false)) {
                moveTo("heads." + key + ".displayname", "heads." + key + ".display-name", ConfigHeads.get());
                moveTo("heads." + key + ".texture", "heads." + key + ".texture", ConfigHeads.get());
                if (get("heads." + key + ".price") instanceof Double) {
                    moveTo("heads." + key + ".price", "heads.HP#" + key + ".price", ConfigHeadsSelector.get());
                }
                moveTo("heads." + key + ".section", "heads.HP#" + key + ".section", ConfigHeadsSelector.get());
            }
        }

        // For each section
        if (contains("sections")) {
            for (String key : getConfigSection("sections").getKeys(false)) {
                moveTo("sections." + key + ".texture", "sections." + key + ".texture", ConfigHeadsSelector.get());
                moveTo("sections." + key + ".display-name", "sections." + key + ".display-name", ConfigHeadsSelector.get());
                ConfigHeadsSelector.get().addDefault("sections." + key + ".enabled", true);
                ConfigHeadsSelector.get().addDefault("sections." + key + ".permission", "headsplus.section." + key);
            }
        }
    }

    @Override
    public void save() throws IOException {
        File customHeads = new File(HeadsPlus.get().getDataFolder(), "customheads.yml");
        if (!customHeads.exists()) return;
        if (!customHeads.renameTo(new File(HeadsPlus.get().getDataFolder(), "customheads-backup.yml"))) {
            HeadsPlus.get().getLogger().warning("Failed to rename customheads.yml to customheads-backup.yml name! You will need to do this yourself.");
        }
    }

    public static ConfigCustomHeads get() {
        return instance;
    }

}

{'fraction_non_alphanumeric': 0.15166420724708968, 'fraction_numerical': 0.003935071323167732, 'mean_word_length': 2.7631091918568784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2409461', 'n_tokens_mistral': 1750, 'n_tokens_neox': 1679, 'n_words': 343}