cpw.mods.fml.client
Class FMLClientHandler

java.lang.Object
  extended by cpw.mods.fml.client.FMLClientHandler
All Implemented Interfaces:
IFMLSidedHandler

public class FMLClientHandler
extends Object
implements IFMLSidedHandler

Handles primary communication from hooked code into the system The FML entry point is beginMinecraftLoading(Minecraft) 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.

Author:
cpw

Constructor Summary
FMLClientHandler()
           
 
Method Summary
 void addSpecialModEntries(ArrayList<ModContainer> mods)
           
 void adjustEntityLocationOnClient(EntitySpawnAdjustmentPacket packet)
           
 void beginMinecraftLoading(Minecraft minecraft)
          Called to start the whole game off
 void beginServerLoading(MinecraftServer server)
           
 void callbackIdDifferenceResponse(boolean response)
           
 void disconnectIDMismatch(com.google.common.collect.MapDifference<Integer,ItemData> s, NetHandler toKill, INetworkManager mgr)
           
 void displayGuiScreen(EntityPlayer player, GuiScreen gui)
           
 void displayMissingMods(ModMissingPacket modMissingPacket)
           
 void finishMinecraftLoading()
          Called a bit later on during initialization to finish loading mods Also initializes key bindings
 void finishServerLoading()
           
 List<String> getAdditionalBrandingInformation()
           
 Minecraft getClient()
          Get the server instance
 byte getClientCompatibilityLevel()
           
 Logger getMinecraftLogger()
          Get a handle to the client's logger instance The client actually doesn't have one- so we return null
 MinecraftServer getServer()
           
 Side getSide()
           
 void haltGame(String message, Throwable t)
           
 void handleTinyPacket(NetHandler handler, Packet131MapData mapData)
           
 boolean hasOptifine()
           
static FMLClientHandler instance()
           
 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 sendPacket(Packet packet)
           
 void setClientCompatibilityLevel(byte compatibilityLevel)
           
 boolean shouldServerShouldBeKilledQuietly()
           
 void showGuiScreen(Object clientGuiElement)
           
 Entity spawnEntityIntoClientWorld(EntityRegistry.EntityRegistration er, EntitySpawnPacket packet)
           
 void warnIDMismatch(com.google.common.collect.MapDifference<Integer,ItemData> idDifferences, boolean mayContinue)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FMLClientHandler

public FMLClientHandler()
Method Detail

beginMinecraftLoading

public void beginMinecraftLoading(Minecraft minecraft)
Called to start the whole game off

Parameters:
minecraft - The minecraft instance being launched

haltGame

public void haltGame(String message,
                     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


onInitializationComplete

public void onInitializationComplete()

getClient

public Minecraft getClient()
Get the server instance


getMinecraftLogger

public Logger getMinecraftLogger()
Get a handle to the client's logger instance The client actually doesn't have one- so we return null


instance

public static FMLClientHandler instance()
Returns:
the instance

displayGuiScreen

public void displayGuiScreen(EntityPlayer player,
                             GuiScreen gui)
Parameters:
player -
gui -

addSpecialModEntries

public void addSpecialModEntries(ArrayList<ModContainer> mods)
Parameters:
mods -

getAdditionalBrandingInformation

public List<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(Object clientGuiElement)
Specified by:
showGuiScreen in interface IFMLSidedHandler

spawnEntityIntoClientWorld

public Entity spawnEntityIntoClientWorld(EntityRegistry.EntityRegistration er,
                                         EntitySpawnPacket packet)
Specified by:
spawnEntityIntoClientWorld in interface IFMLSidedHandler

adjustEntityLocationOnClient

public void adjustEntityLocationOnClient(EntitySpawnAdjustmentPacket packet)
Specified by:
adjustEntityLocationOnClient in interface IFMLSidedHandler

beginServerLoading

public void beginServerLoading(MinecraftServer server)
Specified by:
beginServerLoading in interface IFMLSidedHandler

finishServerLoading

public void finishServerLoading()
Specified by:
finishServerLoading in interface IFMLSidedHandler

getServer

public MinecraftServer getServer()
Specified by:
getServer in interface IFMLSidedHandler

sendPacket

public void sendPacket(Packet packet)
Specified by:
sendPacket in interface IFMLSidedHandler

displayMissingMods

public void displayMissingMods(ModMissingPacket modMissingPacket)
Specified by:
displayMissingMods in interface IFMLSidedHandler

isLoading

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


handleTinyPacket

public void handleTinyPacket(NetHandler handler,
                             Packet131MapData mapData)
Specified by:
handleTinyPacket in interface IFMLSidedHandler

setClientCompatibilityLevel

public void setClientCompatibilityLevel(byte compatibilityLevel)
Specified by:
setClientCompatibilityLevel in interface IFMLSidedHandler

getClientCompatibilityLevel

public byte getClientCompatibilityLevel()
Specified by:
getClientCompatibilityLevel in interface IFMLSidedHandler

warnIDMismatch

public void warnIDMismatch(com.google.common.collect.MapDifference<Integer,ItemData> idDifferences,
                           boolean mayContinue)

callbackIdDifferenceResponse

public void callbackIdDifferenceResponse(boolean response)

shouldServerShouldBeKilledQuietly

public boolean shouldServerShouldBeKilledQuietly()
Specified by:
shouldServerShouldBeKilledQuietly in interface IFMLSidedHandler

disconnectIDMismatch

public void disconnectIDMismatch(com.google.common.collect.MapDifference<Integer,ItemData> s,
                                 NetHandler toKill,
                                 INetworkManager mgr)
Specified by:
disconnectIDMismatch in interface IFMLSidedHandler