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", (String)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 = Language.get("main.pe.mrt.dev.popup");
   private static final String POPUP_OLD_VERSIONS = Language.get("main.pe.mrt.old.popup");
   private static final Map<String, MinecraftReleaseType> LOOKUP = Maps.newHashMap();
   private final String name;
   private final String description;

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

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

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

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

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

   static {
      MinecraftReleaseType[] var0 = values();
      int var1 = var0.length;

      for(int var2 = 0; var2 < var1; ++var2) {
         MinecraftReleaseType type = var0[var2];
         LOOKUP.put(type.getName(), type);
      }

   }
}
