001package net.minecraft.client; 002 003import cpw.mods.fml.relauncher.Side; 004import cpw.mods.fml.relauncher.SideOnly; 005import java.awt.BorderLayout; 006import java.awt.Canvas; 007import net.minecraft.client.settings.GameSettings; 008import net.minecraft.crash.CrashReport; 009import org.lwjgl.LWJGLException; 010 011@SideOnly(Side.CLIENT) 012public class MinecraftAppletImpl extends Minecraft 013{ 014 /** Reference to the main frame, in this case, the applet window itself. */ 015 final MinecraftApplet mainFrame; 016 017 public MinecraftAppletImpl(MinecraftApplet par1MinecraftApplet, Canvas par2Canvas, MinecraftApplet par3MinecraftApplet, int par4, int par5, boolean par6) 018 { 019 super(par2Canvas, par3MinecraftApplet, par4, par5, par6); 020 this.mainFrame = par1MinecraftApplet; 021 } 022 023 public void displayCrashReportInternal(CrashReport par1CrashReport) 024 { 025 this.mainFrame.removeAll(); 026 this.mainFrame.setLayout(new BorderLayout()); 027 this.mainFrame.add(new PanelCrashReport(par1CrashReport), "Center"); 028 this.mainFrame.validate(); 029 } 030 031 /** 032 * Starts the game: initializes the canvas, the title, the settings, etcetera. 033 */ 034 public void startGame() throws LWJGLException 035 { 036 this.mcDataDir = getMinecraftDir(); 037 this.gameSettings = new GameSettings(this, this.mcDataDir); 038 039 if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0 && this.mainFrame.getParent() != null && this.mainFrame.getParent().getParent() != null) 040 { 041 this.mainFrame.getParent().getParent().setSize(this.gameSettings.overrideWidth, this.gameSettings.overrideHeight); 042 } 043 044 super.startGame(); 045 } 046}