/*
 * Decompiled with CFR 0.152.
 */
package meteordevelopment.meteorclient.systems.modules.donut;

import meteordevelopment.meteorclient.settings.EnumSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Categories;
import meteordevelopment.meteorclient.systems.modules.Module;

public class DonutRanks
extends Module {
    private final SettingGroup sgGeneral;
    private final Setting<Rank> rank;

    public DonutRanks() {
        super(Categories.Donut, "donut-ranks", "Fakes Donut SMP ranks next to your name client-side.");
        this.sgGeneral = this.settings.getDefaultGroup();
        this.rank = this.sgGeneral.add(((EnumSetting.Builder)((EnumSetting.Builder)((EnumSetting.Builder)new EnumSetting.Builder().name("rank")).description("The Donut SMP rank to spoof next to your name.")).defaultValue(Rank.Owner)).build());
    }

    public String replaceName(String name) {
        if (!this.isActive() || this.mc.method_1548() == null) {
            return name;
        }
        String myName = this.mc.method_1548().method_1676();
        if (name != null && name.contains(myName)) {
            return name.replace(myName, this.rank.get().prefix + " \u00a7r" + myName + "\u00a7r");
        }
        return name;
    }

    public static enum Rank {
        Owner("\u00a74[Owner]"),
        Dev("\u00a7b[Dev]"),
        Mod("\u00a7a[Mod]"),
        Media("\u00a7d[Media]");

        public final String prefix;

        private Rank(String prefix) {
            this.prefix = prefix;
        }
    }
}

