cpw.mods.fml.client

## Class FMLClientHandler

- java.lang.Object
- - cpw.mods.fml.client.FMLClientHandler

- All Implemented Interfaces:
    IFMLSidedHandler

      public class FMLClientHandler
      extends java.lang.Object
      implements IFMLSidedHandler

  Handles primary communication from hooked code into the system The FML entry point is `#beginMinecraftLoading(Minecraft, List)` called from `Minecraft` Obfuscated code should focus on this class and other members of the "server" (or "client") code The actual mod loading is handled at arms length by `Loader` It is expected that a similar class will exist for each target environment: Bukkit and Client side. It should not be directly modified.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FMLClientHandler()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addModAsResource(ModContainer container)`
    `void` | `addSpecialModEntries(java.util.ArrayList<ModContainer> mods)`
    `void` | `beginMinecraftLoading(Minecraft minecraft, java.util.List resourcePackList, IReloadableResourceManager resourceManager)` Called to start the whole game off
    `void` | `beginServerLoading(MinecraftServer server)`
    `void` | `bindServerListData(ServerData data, ServerStatusResponse originalResponse)`
    `void` | `captureAdditionalData(ServerStatusResponse serverstatusresponse, com.google.gson.JsonObject jsonobject)`
    `void` | `connectToServer(GuiScreen guiMultiplayer, ServerData serverEntry)`
    `void` | `connectToServerAtStartup(java.lang.String host, int port)`
    `void` | `displayGuiScreen(EntityPlayer player, GuiScreen gui)`
    `void` | `displayMissingMods(java.lang.Object modMissingPacket)`
    `java.lang.String` | `enhanceServerListEntry(ServerListEntryNormal serverListEntry, ServerData serverEntry, int x, int width, int y, int relativeMouseX, int relativeMouseY)`
    `void` | `extendModList()`
    `void` | `finishMinecraftLoading()` Called a bit later on during initialization to finish loading mods Also initializes key bindings
    `void` | `finishServerLoading()`
    `void` | `fireNetRegistrationEvent(EventBus bus, NetworkManager manager, java.util.Set<java.lang.String> channelSet, java.lang.String channel, Side side)`
    `java.lang.String` | `fixDescription(java.lang.String description)`
    `java.util.List<java.lang.String>` | `getAdditionalBrandingInformation()`
    `Minecraft` | `getClient()` Get the server instance
    `EntityClientPlayerMP` | `getClientPlayerEntity()`
    `INetHandler` | `getClientPlayHandler()`
    `NetworkManager` | `getClientToServerNetworkManager()`
    `java.lang.String` | `getCurrentLanguage()`
    `IModGuiFactory` | `getGuiFactoryFor(ModContainer selectedMod)`
    `IResourcePack` | `getResourcePackFor(java.lang.String modId)`
    `java.io.File` | `getSavesDir()`
    `java.io.File` | `getSavesDirectory()`
    `MinecraftServer` | `getServer()`
    `Side` | `getSide()`
    `WorldClient` | `getWorldClient()`
    `void` | `haltGame(java.lang.String message, java.lang.Throwable t)`
    `void` | `handleClientWorldClosing(WorldClient world)`
    `boolean` | `handleLoadingScreen(ScaledResolution scaledResolution)`
    `boolean` | `hasOptifine()`
    `static FMLClientHandler` | `instance()`
    `boolean` | `isGUIOpen(java.lang.Class<? extends GuiScreen> gui)` Is this GUI type open?
    `boolean` | `isLoading()` If the client is in the midst of loading, we disable saving so that custom settings aren't wiped out
    `void` | `onInitializationComplete()`
    `void` | `queryUser(StartupQuery query)`
    `void` | `serverStopped()`
    `void` | `setPlayClient(NetHandlerPlayClient netHandlerPlayClient)`
    `void` | `setupServerList()`
    `boolean` | `shouldAllowPlayerLogins()`
    `boolean` | `shouldServerShouldBeKilledQuietly()`
    `void` | `showGuiScreen(java.lang.Object clientGuiElement)`
    `void` | `showInGameModOptions(GuiIngameMenu guiIngameMenu)`
    `void` | `startIntegratedServer(java.lang.String id, java.lang.String name, WorldSettings settings)`
    `void` | `tryLoadExistingWorld(GuiSelectWorld selectWorldGUI, java.lang.String dirName, java.lang.String saveName)`
    `void` | `waitForPlayClient()`

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

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

- - ### Constructor Detail

    - #### FMLClientHandler

          public FMLClientHandler()

  - ### Method Detail

    - #### beginMinecraftLoading

          public void beginMinecraftLoading(Minecraft minecraft,
                                   java.util.List resourcePackList,
                                   IReloadableResourceManager resourceManager)

      Called to start the whole game off
      Parameters:
        `minecraft` - The minecraft instance being launched
        `resourcePackList` - The resource pack list we will populate with mods
        `resourceManager` - The resource manager

    - #### haltGame

          public void haltGame(java.lang.String message,
                      java.lang.Throwable t)

      Specified by:
        `haltGame` in interface `IFMLSidedHandler`

    - #### finishMinecraftLoading

          public void finishMinecraftLoading()

      Called a bit later on during initialization to finish loading mods Also initializes key bindings

    - #### extendModList

          public void extendModList()

    - #### onInitializationComplete

          public void onInitializationComplete()

    - #### getClient

          public Minecraft getClient()

      Get the server instance

    - #### instance

          public static FMLClientHandler instance()

      Returns:
        the instance

    - #### displayGuiScreen

          public void displayGuiScreen(EntityPlayer player,
                              GuiScreen gui)

      Parameters:
        `player` -
        `gui` -

    - #### addSpecialModEntries

          public void addSpecialModEntries(java.util.ArrayList<ModContainer> mods)

      Parameters:
        `mods` -

    - #### getAdditionalBrandingInformation

          public java.util.List<java.lang.String> getAdditionalBrandingInformation()

      Specified by:
        `getAdditionalBrandingInformation` in interface `IFMLSidedHandler`

    - #### getSide

          public Side getSide()

      Specified by:
        `getSide` in interface `IFMLSidedHandler`

    - #### hasOptifine

          public boolean hasOptifine()

    - #### showGuiScreen

          public void showGuiScreen(java.lang.Object clientGuiElement)

      Specified by:
        `showGuiScreen` in interface `IFMLSidedHandler`

    - #### queryUser

          public void queryUser(StartupQuery query)
                         throws java.lang.InterruptedException

      Specified by:
        `queryUser` in interface `IFMLSidedHandler`
      Throws:
        `java.lang.InterruptedException`

    - #### handleLoadingScreen

          public boolean handleLoadingScreen(ScaledResolution scaledResolution)

    - #### getWorldClient

          public WorldClient getWorldClient()

    - #### getClientPlayerEntity

          public EntityClientPlayerMP getClientPlayerEntity()

    - #### beginServerLoading

          public void beginServerLoading(MinecraftServer server)

      Specified by:
        `beginServerLoading` in interface `IFMLSidedHandler`

    - #### finishServerLoading

          public void finishServerLoading()

      Specified by:
        `finishServerLoading` in interface `IFMLSidedHandler`

    - #### getSavesDirectory

          public java.io.File getSavesDirectory()

      Specified by:
        `getSavesDirectory` in interface `IFMLSidedHandler`

    - #### getServer

          public MinecraftServer getServer()

      Specified by:
        `getServer` in interface `IFMLSidedHandler`

    - #### displayMissingMods

          public void displayMissingMods(java.lang.Object modMissingPacket)

    - #### isLoading

          public boolean isLoading()

      If the client is in the midst of loading, we disable saving so that custom settings aren't wiped out

    - #### shouldServerShouldBeKilledQuietly

          public boolean shouldServerShouldBeKilledQuietly()

      Specified by:
        `shouldServerShouldBeKilledQuietly` in interface `IFMLSidedHandler`

    - #### isGUIOpen

          public boolean isGUIOpen(java.lang.Class<? extends GuiScreen> gui)

      Is this GUI type open?
      Parameters:
        `gui` - The type of GUI to test for
      Returns:
        if a GUI of this type is open

    - #### addModAsResource

          public void addModAsResource(ModContainer container)

      Specified by:
        `addModAsResource` in interface `IFMLSidedHandler`

    - #### getResourcePackFor

          public IResourcePack getResourcePackFor(java.lang.String modId)

    - #### getCurrentLanguage

          public java.lang.String getCurrentLanguage()

      Specified by:
        `getCurrentLanguage` in interface `IFMLSidedHandler`

    - #### serverStopped

          public void serverStopped()

      Specified by:
        `serverStopped` in interface `IFMLSidedHandler`

    - #### getClientPlayHandler

          public INetHandler getClientPlayHandler()

      Specified by:
        `getClientPlayHandler` in interface `IFMLSidedHandler`

    - #### getClientToServerNetworkManager

          public NetworkManager getClientToServerNetworkManager()

      Specified by:
        `getClientToServerNetworkManager` in interface `IFMLSidedHandler`

    - #### handleClientWorldClosing

          public void handleClientWorldClosing(WorldClient world)

    - #### startIntegratedServer

          public void startIntegratedServer(java.lang.String id,
                                   java.lang.String name,
                                   WorldSettings settings)

    - #### getSavesDir

          public java.io.File getSavesDir()

    - #### tryLoadExistingWorld

          public void tryLoadExistingWorld(GuiSelectWorld selectWorldGUI,
                                  java.lang.String dirName,
                                  java.lang.String saveName)

    - #### showInGameModOptions

          public void showInGameModOptions(GuiIngameMenu guiIngameMenu)

    - #### getGuiFactoryFor

          public IModGuiFactory getGuiFactoryFor(ModContainer selectedMod)

    - #### setupServerList

          public void setupServerList()

    - #### captureAdditionalData

          public void captureAdditionalData(ServerStatusResponse serverstatusresponse,
                                   com.google.gson.JsonObject jsonobject)

    - #### bindServerListData

          public void bindServerListData(ServerData data,
                                ServerStatusResponse originalResponse)

    - #### enhanceServerListEntry

          public java.lang.String enhanceServerListEntry(ServerListEntryNormal serverListEntry,
                                                ServerData serverEntry,
                                                int x,
                                                int width,
                                                int y,
                                                int relativeMouseX,
                                                int relativeMouseY)

    - #### fixDescription

          public java.lang.String fixDescription(java.lang.String description)

    - #### connectToServerAtStartup

          public void connectToServerAtStartup(java.lang.String host,
                                      int port)

    - #### connectToServer

          public void connectToServer(GuiScreen guiMultiplayer,
                             ServerData serverEntry)

    - #### setPlayClient

          public void setPlayClient(NetHandlerPlayClient netHandlerPlayClient)

    - #### waitForPlayClient

          public void waitForPlayClient()

      Specified by:
        `waitForPlayClient` in interface `IFMLSidedHandler`

    - #### fireNetRegistrationEvent

          public void fireNetRegistrationEvent(EventBus bus,
                                      NetworkManager manager,
                                      java.util.Set<java.lang.String> channelSet,
                                      java.lang.String channel,
                                      Side side)

      Specified by:
        `fireNetRegistrationEvent` in interface `IFMLSidedHandler`

    - #### shouldAllowPlayerLogins

          public boolean shouldAllowPlayerLogins()

      Specified by:
        `shouldAllowPlayerLogins` in interface `IFMLSidedHandler`