net.minecraft.client

## Class Minecraft

- java.lang.Object
- - net.minecraft.client.Minecraft

- All Implemented Interfaces:
    Runnable, IPlayerUsage
  Direct Known Subclasses:
    MinecraftAppletImpl

      public abstract class Minecraft
      extends Object
      implements Runnable, IPlayerUsage

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `GuiScreen` | `currentScreen` The GuiScreen that's being displayed at the moment.
    `String` | `debug` String that shows the debug information
    `int` | `displayHeight`
    `int` | `displayWidth`
    `EffectRenderer` | `effectRenderer`
    `EntityRenderer` | `entityRenderer`
    `FontRenderer` | `fontRenderer` The font renderer used for displaying and measuring text.
    `GameSettings` | `gameSettings` The game settings that currently hold effect.
    `GuiAchievement` | `guiAchievement` Gui achievement
    `boolean` | `hideQuitButton` a boolean to hide a Quit button from the main menu
    `GuiIngame` | `ingameGUI`
    `boolean` | `inGameHasFocus` Does the actual gameplay have focus.
    `boolean` | `isGamePaused`
    `LoadingScreenRenderer` | `loadingScreen`
    `Canvas` | `mcCanvas`
    `File` | `mcDataDir`
    `Profiler` | `mcProfiler` The profiler instance
    `static byte[]` | `memoryReserve` A 10MiB preallocation to ensure the heap is reasonably sized.
    `String` | `minecraftUri`
    `MouseHelper` | `mouseHelper` Mouse helper instance.
    `MovingObjectPosition` | `objectMouseOver` The ray trace hit that the mouse is over.
    `PlayerControllerMP` | `playerController`
    `RenderEngine` | `renderEngine` The RenderEngine instance used by Minecraft
    `RenderGlobal` | `renderGlobal`
    `EntityLiving` | `renderViewEntity` The Entity from which the renderer determines the render viewpoint.
    `boolean` | `running` Set to true to keep the game loop running.
    `Session` | `session`
    `boolean` | `skipRenderWorld` Skip render world
    `SoundManager` | `sndManager`
    `FontRenderer` | `standardGalacticFontRenderer`
    `StatFileWriter` | `statFileWriter` Stat file writer
    `TexturePackList` | `texturePackList` The TexturePackLister used by this instance of Minecraft...
    `EntityClientPlayerMP` | `thePlayer`
    `WorldClient` | `theWorld`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Minecraft(Canvas par1Canvas, MinecraftApplet par2MinecraftApplet, int par3, int par4, boolean par5)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CrashReport` | `addGraphicsAndWorldToCrashReport(CrashReport par1CrashReport)` adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report
    `void` | `addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)`
    `void` | `addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)`
    `void` | `continueWorldLoading()`
    `void` | `crashed(CrashReport par1CrashReport)`
    `String` | `debugInfoEntities()` A String of how many entities are in the world
    `String` | `debugInfoRenders()` A String of renderGlobal.getDebugInfoRenders
    `void` | `displayCrashReport(CrashReport par1CrashReport)` Wrapper around displayCrashReportInternal
    `abstract void` | `displayCrashReportInternal(CrashReport var1)`
    `void` | `displayGuiScreen(GuiScreen par1GuiScreen)` Sets the argument GuiScreen as the main (topmost visible) screen.
    `void` | `displayInGameMenu()` Displays the ingame menu
    `static void` | `fmlReentry(ArgsWrapper wrapper)`
    `void` | `freeMemory()`
    `static File` | `getAppDir(String par0Str)` gets the working dir (OS specific) for the specific application (which is always minecraft)
    `String` | `getEntityDebug()` Gets the information in the F3 menu about how many entities are infront/around you
    `IntegratedServer` | `getIntegratedServer()` Returns the currently running integrated server
    `static Minecraft` | `getMinecraft()` Return the singleton Minecraft instance for the game
    `static File` | `getMinecraftDir()` gets the working dir (OS specific) for minecraft
    `static EnumOS` | `getOs()`
    `PlayerUsageSnooper` | `getPlayerUsageSnooper()` Returns the PlayerUsageSnooper instance.
    `ISaveFormat` | `getSaveLoader()` Returns the save loader that is currently being used
    `NetClientHandler` | `getSendQueue()` get the client packet send queue
    `ServerData` | `getServerData()` Get the current ServerData instance.
    `static long` | `getSystemTime()` Gets the system time in milliseconds.
    `String` | `getWorldProviderName()` Gets the name of the world's current chunk provider
    `boolean` | `handleClientCommand(String par1Str)` Returns true if the message is a client command and should not be sent to the server.
    `void` | `installResource(String par1Str, File par2File)` Installs a resource.
    `static boolean` | `isAmbientOcclusionEnabled()` Returns if ambient occlusion is enabled
    `static boolean` | `isDebugInfoEnabled()`
    `boolean` | `isDemo()` Gets whether this is a demo or not.
    `static boolean` | `isFancyGraphicsEnabled()`
    `boolean` | `isFullScreen()` Returns whether we're in full screen or not.
    `static boolean` | `isGuiEnabled()`
    `boolean` | `isIntegratedServerRunning()`
    `boolean` | `isSingleplayer()` Returns true if there is only one player playing, and the current server is the integrated one.
    `boolean` | `isSnooperEnabled()` Returns whether snooping is enabled or not.
    `void` | `launchIntegratedServer(String par1Str, String par2Str, WorldSettings par3WorldSettings)` Arguments: World foldername, World ingame name, WorldSettings
    `void` | `loadWorld(WorldClient par1WorldClient)` unloads the current world first
    `void` | `loadWorld(WorldClient par1WorldClient, String par2Str)` par2Str is displayed on the loading screen to the user unloads the current world first
    `static void` | `main(String[] par0ArrayOfStr)`
    `void` | `run()`
    `void` | `runTick()` Runs the current tick.
    `void` | `scaledTessellator(int par1, int par2, int par3, int par4, int par5, int par6)` Loads Tessellator with a scaled resolution
    `void` | `scheduleTexturePackRefresh()` Sets refreshTexturePacksScheduled to true, triggering a texture pack refresh next time the while(running) loop is run
    `void` | `setDimensionAndSpawnPlayer(int par1)`
    `void` | `setIngameFocus()` Will set the focus to ingame if the Minecraft window is the active with focus.
    `void` | `setIngameNotInFocus()` Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor.
    `void` | `setServer(String par1Str, int par2)`
    `void` | `setServerData(ServerData par1ServerData)` Set the current ServerData instance.
    `void` | `shutdown()` Called when the window is closing.
    `void` | `shutdownMinecraftApplet()` Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the application (or web page) is exited.
    `void` | `startGame()` Starts the game: initializes the canvas, the title, the settings, etcetera.
    `static void` | `stopIntegratedServer()`
    `void` | `toggleFullscreen()` Toggles fullscreen mode.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### memoryReserve

          public static byte[] memoryReserve

      A 10MiB preallocation to ensure the heap is reasonably sized.

    - #### playerController

          public PlayerControllerMP playerController

    - #### displayWidth

          public int displayWidth

    - #### displayHeight

          public int displayHeight

    - #### theWorld

          public WorldClient theWorld

    - #### renderGlobal

          public RenderGlobal renderGlobal

    - #### thePlayer

          public EntityClientPlayerMP thePlayer

    - #### renderViewEntity

          public EntityLiving renderViewEntity

      The Entity from which the renderer determines the render viewpoint. Currently is always the parent Minecraft class's 'thePlayer' instance. Modification of its location, rotation, or other settings at render time will modify the camera likewise, with the caveat of triggering chunk rebuilds as it moves, making it unsuitable for changing the viewpoint mid-render.

    - #### effectRenderer

          public EffectRenderer effectRenderer

    - #### session

          public Session session

    - #### minecraftUri

          public String minecraftUri

    - #### mcCanvas

          public Canvas mcCanvas

    - #### hideQuitButton

          public boolean hideQuitButton

      a boolean to hide a Quit button from the main menu

    - #### isGamePaused

          public volatile boolean isGamePaused

    - #### renderEngine

          public RenderEngine renderEngine

      The RenderEngine instance used by Minecraft

    - #### fontRenderer

          public FontRenderer fontRenderer

      The font renderer used for displaying and measuring text.

    - #### standardGalacticFontRenderer

          public FontRenderer standardGalacticFontRenderer

    - #### currentScreen

          public GuiScreen currentScreen

      The GuiScreen that's being displayed at the moment.

    - #### loadingScreen

          public LoadingScreenRenderer loadingScreen

    - #### entityRenderer

          public EntityRenderer entityRenderer

    - #### guiAchievement

          public GuiAchievement guiAchievement

      Gui achievement

    - #### ingameGUI

          public GuiIngame ingameGUI

    - #### skipRenderWorld

          public boolean skipRenderWorld

      Skip render world

    - #### objectMouseOver

          public MovingObjectPosition objectMouseOver

      The ray trace hit that the mouse is over.

    - #### gameSettings

          public GameSettings gameSettings

      The game settings that currently hold effect.

    - #### sndManager

          public SoundManager sndManager

    - #### mouseHelper

          public MouseHelper mouseHelper

      Mouse helper instance.

    - #### texturePackList

          public TexturePackList texturePackList

      The TexturePackLister used by this instance of Minecraft...

    - #### mcDataDir

          public File mcDataDir

    - #### statFileWriter

          public StatFileWriter statFileWriter

      Stat file writer

    - #### inGameHasFocus

          public boolean inGameHasFocus

      Does the actual gameplay have focus. If so then mouse and keys will effect the player instead of menus.

    - #### mcProfiler

          public final Profiler mcProfiler

      The profiler instance

    - #### running

          public volatile boolean running

      Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly.

    - #### debug

          public String debug

      String that shows the debug information

  - ### Constructor Detail

    - #### Minecraft

          public Minecraft(Canvas par1Canvas,
                   MinecraftApplet par2MinecraftApplet,
                   int par3,
                   int par4,
                   boolean par5)

  - ### Method Detail

    - #### crashed

          public void crashed(CrashReport par1CrashReport)

    - #### displayCrashReport

          public void displayCrashReport(CrashReport par1CrashReport)

      Wrapper around displayCrashReportInternal

    - #### displayCrashReportInternal

          public abstract void displayCrashReportInternal(CrashReport var1)

    - #### setServer

          public void setServer(String par1Str,
                       int par2)

    - #### startGame

          public void startGame()
                         throws org.lwjgl.LWJGLException

      Starts the game: initializes the canvas, the title, the settings, etcetera.
      Throws:
        `org.lwjgl.LWJGLException`

    - #### scaledTessellator

          public void scaledTessellator(int par1,
                               int par2,
                               int par3,
                               int par4,
                               int par5,
                               int par6)

      Loads Tessellator with a scaled resolution

    - #### getMinecraftDir

          public static File getMinecraftDir()

      gets the working dir (OS specific) for minecraft

    - #### getAppDir

          public static File getAppDir(String par0Str)

      gets the working dir (OS specific) for the specific application (which is always minecraft)

    - #### getOs

          public static EnumOS getOs()

    - #### getSaveLoader

          public ISaveFormat getSaveLoader()

      Returns the save loader that is currently being used

    - #### displayGuiScreen

          public void displayGuiScreen(GuiScreen par1GuiScreen)

      Sets the argument GuiScreen as the main (topmost visible) screen.

    - #### shutdownMinecraftApplet

          public void shutdownMinecraftApplet()

      Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the application (or web page) is exited.

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`

    - #### freeMemory

          public void freeMemory()

    - #### shutdown

          public void shutdown()

      Called when the window is closing. Sets 'running' to false which allows the game loop to exit cleanly.

    - #### setIngameFocus

          public void setIngameFocus()

      Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen currently displayed

    - #### setIngameNotInFocus

          public void setIngameNotInFocus()

      Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor.

    - #### displayInGameMenu

          public void displayInGameMenu()

      Displays the ingame menu

    - #### toggleFullscreen

          public void toggleFullscreen()

      Toggles fullscreen mode.

    - #### runTick

          public void runTick()

      Runs the current tick.

    - #### launchIntegratedServer

          public void launchIntegratedServer(String par1Str,
                                    String par2Str,
                                    WorldSettings par3WorldSettings)

      Arguments: World foldername, World ingame name, WorldSettings

    - #### continueWorldLoading

          public void continueWorldLoading()

    - #### loadWorld

          public void loadWorld(WorldClient par1WorldClient)

      unloads the current world first

    - #### loadWorld

          public void loadWorld(WorldClient par1WorldClient,
                       String par2Str)

      par2Str is displayed on the loading screen to the user unloads the current world first

    - #### installResource

          public void installResource(String par1Str,
                             File par2File)

      Installs a resource. Currently only sounds are download so this method just adds them to the SoundManager.

    - #### debugInfoRenders

          public String debugInfoRenders()

      A String of renderGlobal.getDebugInfoRenders

    - #### getEntityDebug

          public String getEntityDebug()

      Gets the information in the F3 menu about how many entities are infront/around you

    - #### getWorldProviderName

          public String getWorldProviderName()

      Gets the name of the world's current chunk provider

    - #### debugInfoEntities

          public String debugInfoEntities()

      A String of how many entities are in the world

    - #### setDimensionAndSpawnPlayer

          public void setDimensionAndSpawnPlayer(int par1)

    - #### isDemo

          public final boolean isDemo()

      Gets whether this is a demo or not.

    - #### getSendQueue

          public NetClientHandler getSendQueue()

      get the client packet send queue

    - #### main

          public static void main(String[] par0ArrayOfStr)

    - #### fmlReentry

          public static void fmlReentry(ArgsWrapper wrapper)

    - #### isGuiEnabled

          public static boolean isGuiEnabled()

    - #### isFancyGraphicsEnabled

          public static boolean isFancyGraphicsEnabled()

    - #### isAmbientOcclusionEnabled

          public static boolean isAmbientOcclusionEnabled()

      Returns if ambient occlusion is enabled

    - #### isDebugInfoEnabled

          public static boolean isDebugInfoEnabled()

    - #### handleClientCommand

          public boolean handleClientCommand(String par1Str)

      Returns true if the message is a client command and should not be sent to the server. However there are no such commands at this point in time.

    - #### addGraphicsAndWorldToCrashReport

          public CrashReport addGraphicsAndWorldToCrashReport(CrashReport par1CrashReport)

      adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report

    - #### getMinecraft

          public static Minecraft getMinecraft()

      Return the singleton Minecraft instance for the game

    - #### scheduleTexturePackRefresh

          public void scheduleTexturePackRefresh()

      Sets refreshTexturePacksScheduled to true, triggering a texture pack refresh next time the while(running) loop is run

    - #### addServerStatsToSnooper

          public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)

      Specified by:
        `addServerStatsToSnooper` in interface `IPlayerUsage`

    - #### addServerTypeToSnooper

          public void addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper)

      Specified by:
        `addServerTypeToSnooper` in interface `IPlayerUsage`

    - #### isSnooperEnabled

          public boolean isSnooperEnabled()

      Returns whether snooping is enabled or not.
      Specified by:
        `isSnooperEnabled` in interface `IPlayerUsage`

    - #### setServerData

          public void setServerData(ServerData par1ServerData)

      Set the current ServerData instance.

    - #### getServerData

          public ServerData getServerData()

      Get the current ServerData instance.

    - #### isIntegratedServerRunning

          public boolean isIntegratedServerRunning()

    - #### isSingleplayer

          public boolean isSingleplayer()

      Returns true if there is only one player playing, and the current server is the integrated one.

    - #### getIntegratedServer

          public IntegratedServer getIntegratedServer()

      Returns the currently running integrated server

    - #### stopIntegratedServer

          public static void stopIntegratedServer()

    - #### getPlayerUsageSnooper

          public PlayerUsageSnooper getPlayerUsageSnooper()

      Returns the PlayerUsageSnooper instance.

    - #### getSystemTime

          public static long getSystemTime()

      Gets the system time in milliseconds.

    - #### isFullScreen

          public boolean isFullScreen()

      Returns whether we're in full screen or not.