/*
 * Decompiled with CFR 0.152.
 */
package net.minecraft.launcher.game;

import com.google.common.collect.Maps;
import com.mojang.launcher.versions.ReleaseType;
import java.util.Map;
import net.minecraft.launcher.Language;

public enum MinecraftReleaseType implements ReleaseType
{
    SNAPSHOT("snapshot", Language.get("main.pe.mrt.snap")),
    RELEASE("release", null),
    OLD_BETA("old_beta", Language.get("main.pe.mrt.oldbeta")),
    OLD_ALPHA("old_alpha", Language.get("main.pe.mrt.oldalpha"));

    private static final String POPUP_DEV_VERSIONS;
    private static final String POPUP_OLD_VERSIONS;
    private static final Map<String, MinecraftReleaseType> LOOKUP;
    private final String name;
    private final String description;

    private MinecraftReleaseType(String name, String description) {
        this.name = name;
        this.description = description;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public String getDescription() {
        return this.description;
    }

    public String getPopupWarning() {
        if (this.description == null) {
            return null;
        }
        if (this == SNAPSHOT) {
            return Language.get("main.pe.mrt.snap.popup");
        }
        if (this == OLD_BETA) {
            return Language.get("main.pe.mrt.oldbeta.popup");
        }
        if (this == OLD_ALPHA) {
            return Language.get("main.pe.mrt.oldalpha.popup");
        }
        return null;
    }

    public static MinecraftReleaseType getByName(String name) {
        return LOOKUP.get(name);
    }

    static {
        POPUP_DEV_VERSIONS = Language.get("main.pe.mrt.dev.popup");
        POPUP_OLD_VERSIONS = Language.get("main.pe.mrt.old.popup");
        LOOKUP = Maps.newHashMap();
        for (MinecraftReleaseType type : MinecraftReleaseType.values()) {
            LOOKUP.put(type.getName(), type);
        }
    }
}
