    001package net.minecraft.client;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import java.applet.Applet;
    006import java.applet.AppletStub;
    007import java.net.MalformedURLException;
    008import java.net.URL;
    009import java.util.Map;
    010
    011@SideOnly(Side.CLIENT)
    012public class MinecraftFakeLauncher extends Applet implements AppletStub
    013{
    014    /** Arguments that were passed to Minecraft.jar (username, sessionid etc) */
    015    final Map arguments;
    016
    017    public MinecraftFakeLauncher(Map par1Map)
    018    {
    019        this.arguments = par1Map;
    020    }
    021
    022    public void appletResize(int par1, int par2) {}
    023
    024    public boolean isActive()
    025    {
    026        return true;
    027    }
    028
    029    public URL getDocumentBase()
    030    {
    031        try
    032        {
    033            return new URL("http://www.minecraft.net/game/");
    034        }
    035        catch (MalformedURLException var2)
    036        {
    037            var2.printStackTrace();
    038            return null;
    039        }
    040    }
    041
    042    public String getParameter(String par1Str)
    043    {
    044        if (this.arguments.containsKey(par1Str))
    045        {
    046            return (String)this.arguments.get(par1Str);
    047        }
    048        else
    049        {
    050            System.err.println("Client asked for parameter: " + par1Str);
    051            return null;
    052        }
    053    }
    054}