public class FMLClientHandler extends java.lang.Object implements IFMLSidedHandler
beginMinecraftLoading(Minecraft, List, IReloadableResourceManager, MetadataSerializer)
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.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALLOWED_CHARS |
private java.util.Set<java.lang.String> |
badTextureDomains |
private com.google.common.collect.Table<java.lang.String,java.lang.String,java.util.Set<ResourceLocation>> |
brokenTextures |
private Minecraft |
client
A reference to the server itself
|
private CloudRenderer |
cloudRenderer |
private java.lang.ref.WeakReference<NetHandlerPlayClient> |
currentPlayClient |
private static com.google.common.base.CharMatcher |
DISALLOWED_CHAR_MATCHER |
private IDisplayableError |
errorToDisplay |
private java.util.Map<ServerStatusResponse,com.google.gson.JsonObject> |
extraServerListData |
private com.google.common.collect.BiMap<ModContainer,IModGuiFactory> |
guiFactories |
private static ResourceLocation |
iconSheet |
private static FMLClientHandler |
INSTANCE
The singleton
|
private boolean |
loading |
private MetadataSerializer |
metaSerializer |
private com.google.common.collect.SetMultimap<java.lang.String,ResourceLocation> |
missingTextures |
private MissingModsException |
modsMissing
Deprecated.
|
private DummyModContainer |
optifineContainer |
private java.util.List<IResourcePack> |
resourcePackList |
private java.util.Map<java.lang.String,IResourcePack> |
resourcePackMap |
private java.util.Map<ServerData,ExtendedServerListData> |
serverDataTag |
private boolean |
serverShouldBeKilledQuietly |
private static java.util.concurrent.CountDownLatch |
startupConnectionData |
Constructor and Description |
---|
FMLClientHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addModAsResource(ModContainer container) |
void |
addSpecialModEntries(java.util.ArrayList<ModContainer> mods) |
void |
allowLogins() |
void |
beginMinecraftLoading(Minecraft minecraft,
java.util.List<IResourcePack> resourcePackList,
IReloadableResourceManager resourceManager,
MetadataSerializer metaSerializer)
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 |
connectToRealmsServer(java.lang.String host,
int port) |
void |
connectToServer(GuiScreen guiMultiplayer,
ServerData serverEntry) |
void |
connectToServerAtStartup(java.lang.String host,
int port) |
private void |
detectOptifine() |
void |
displayGuiScreen(EntityPlayer player,
GuiScreen gui) |
void |
displayMissingMods(java.lang.Object modMissingPacket)
Deprecated.
|
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) |
void |
fireSidedRegistryEvents() |
java.lang.String |
fixDescription(java.lang.String description) |
java.util.List<java.lang.String> |
getAdditionalBrandingInformation() |
Minecraft |
getClient()
Get the server instance
|
EntityPlayerSP |
getClientPlayerEntity() |
INetHandler |
getClientPlayHandler() |
NetworkManager |
getClientToServerNetworkManager() |
private CloudRenderer |
getCloudRenderer() |
java.lang.String |
getCurrentLanguage() |
CompoundDataFixer |
getDataFixer() |
IModGuiFactory |
getGuiFactoryFor(ModContainer selectedMod) |
IResourcePack |
getResourcePackFor(java.lang.String modId) |
java.io.File |
getSavesDir() |
java.io.File |
getSavesDirectory() |
MinecraftServer |
getServer() |
Side |
getSide() |
WorldClient |
getWorldClient() |
IThreadListener |
getWorldThread(INetHandler net) |
void |
haltGame(java.lang.String message,
java.lang.Throwable t) |
void |
handleClientWorldClosing(WorldClient world) |
boolean |
handleLoadingScreen(ScaledResolution scaledResolution) |
boolean |
hasError() |
boolean |
hasOptifine() |
static FMLClientHandler |
instance() |
boolean |
isDisplayCloseRequested() |
boolean |
isDisplayVSyncForced() |
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 |
logMissingTextureErrors() |
void |
onInitializationComplete() |
void |
processWindowMessages() |
void |
queryUser(StartupQuery query) |
void |
refreshResources(IResourceType... inclusion) |
void |
refreshResources(java.util.function.Predicate<IResourceType> resourcePredicate) |
void |
reloadCreativeSettings() |
void |
reloadRenderers() |
void |
reloadSearchTrees() |
boolean |
renderClouds(int cloudTicks,
float partialTicks) |
void |
resetClientRecipeBook() |
com.google.common.util.concurrent.ListenableFuture<java.lang.Object> |
scheduleResourcesRefresh(IResourceType... inclusion) |
com.google.common.util.concurrent.ListenableFuture<java.lang.Object> |
scheduleResourcesRefresh(java.util.function.Predicate<IResourceType> resourcePredicate) |
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) |
java.lang.String |
stripSpecialChars(java.lang.String message) |
void |
trackBrokenTexture(ResourceLocation resourceLocation,
java.lang.String error) |
void |
trackMissingTexture(ResourceLocation resourceLocation) |
void |
tryLoadExistingWorld(GuiWorldSelection selectWorldGUI,
WorldSummary comparator) |
void |
updateCloudSettings() |
private static final FMLClientHandler INSTANCE
private Minecraft client
private DummyModContainer optifineContainer
@Deprecated private MissingModsException modsMissing
private boolean loading
@Nullable private IDisplayableError errorToDisplay
private boolean serverShouldBeKilledQuietly
private java.util.List<IResourcePack> resourcePackList
private MetadataSerializer metaSerializer
private java.util.Map<java.lang.String,IResourcePack> resourcePackMap
private com.google.common.collect.BiMap<ModContainer,IModGuiFactory> guiFactories
private java.util.Map<ServerStatusResponse,com.google.gson.JsonObject> extraServerListData
private java.util.Map<ServerData,ExtendedServerListData> serverDataTag
private java.lang.ref.WeakReference<NetHandlerPlayClient> currentPlayClient
private CloudRenderer cloudRenderer
private static final ResourceLocation iconSheet
private static final java.util.concurrent.CountDownLatch startupConnectionData
private com.google.common.collect.SetMultimap<java.lang.String,ResourceLocation> missingTextures
private java.util.Set<java.lang.String> badTextureDomains
private com.google.common.collect.Table<java.lang.String,java.lang.String,java.util.Set<ResourceLocation>> brokenTextures
private static final java.lang.String ALLOWED_CHARS
private static final com.google.common.base.CharMatcher DISALLOWED_CHAR_MATCHER
public void beginMinecraftLoading(Minecraft minecraft, java.util.List<IResourcePack> resourcePackList, IReloadableResourceManager resourceManager, MetadataSerializer metaSerializer)
minecraft
- The minecraft instance being launchedresourcePackList
- The resource pack list we will populate with modsresourceManager
- The resource managerprivate void detectOptifine()
public void haltGame(java.lang.String message, java.lang.Throwable t)
haltGame
in interface IFMLSidedHandler
public boolean hasError()
public void finishMinecraftLoading()
public void extendModList()
public void onInitializationComplete()
public Minecraft getClient()
public static FMLClientHandler instance()
public void displayGuiScreen(EntityPlayer player, GuiScreen gui)
player
- gui
- public void addSpecialModEntries(java.util.ArrayList<ModContainer> mods)
mods
- public java.util.List<java.lang.String> getAdditionalBrandingInformation()
getAdditionalBrandingInformation
in interface IFMLSidedHandler
public Side getSide()
getSide
in interface IFMLSidedHandler
public boolean hasOptifine()
public void showGuiScreen(@Nullable java.lang.Object clientGuiElement)
showGuiScreen
in interface IFMLSidedHandler
public void queryUser(StartupQuery query) throws java.lang.InterruptedException
queryUser
in interface IFMLSidedHandler
java.lang.InterruptedException
public boolean handleLoadingScreen(ScaledResolution scaledResolution) throws java.io.IOException
java.io.IOException
public WorldClient getWorldClient()
public EntityPlayerSP getClientPlayerEntity()
public void beginServerLoading(MinecraftServer server)
beginServerLoading
in interface IFMLSidedHandler
public void finishServerLoading()
finishServerLoading
in interface IFMLSidedHandler
public java.io.File getSavesDirectory()
getSavesDirectory
in interface IFMLSidedHandler
public MinecraftServer getServer()
getServer
in interface IFMLSidedHandler
@Deprecated public void displayMissingMods(java.lang.Object modMissingPacket)
public boolean isLoading()
public boolean isDisplayCloseRequested()
isDisplayCloseRequested
in interface IFMLSidedHandler
public boolean shouldServerShouldBeKilledQuietly()
shouldServerShouldBeKilledQuietly
in interface IFMLSidedHandler
public boolean isGUIOpen(java.lang.Class<? extends GuiScreen> gui)
gui
- The type of GUI to test forpublic void addModAsResource(ModContainer container)
addModAsResource
in interface IFMLSidedHandler
public IResourcePack getResourcePackFor(java.lang.String modId)
public java.lang.String getCurrentLanguage()
getCurrentLanguage
in interface IFMLSidedHandler
public void serverStopped()
serverStopped
in interface IFMLSidedHandler
public INetHandler getClientPlayHandler()
getClientPlayHandler
in interface IFMLSidedHandler
public NetworkManager getClientToServerNetworkManager()
getClientToServerNetworkManager
in interface IFMLSidedHandler
public void handleClientWorldClosing(WorldClient world)
public void startIntegratedServer(java.lang.String id, java.lang.String name, WorldSettings settings)
public java.io.File getSavesDir()
public void tryLoadExistingWorld(GuiWorldSelection selectWorldGUI, WorldSummary comparator)
public void showInGameModOptions(GuiIngameMenu guiIngameMenu)
public IModGuiFactory getGuiFactoryFor(ModContainer selectedMod)
public void setupServerList()
public void captureAdditionalData(ServerStatusResponse serverstatusresponse, com.google.gson.JsonObject jsonobject)
public void bindServerListData(ServerData data, ServerStatusResponse originalResponse)
@Nullable public java.lang.String enhanceServerListEntry(ServerListEntryNormal serverListEntry, ServerData serverEntry, int x, int width, int y, int relativeMouseX, int relativeMouseY)
public java.lang.String fixDescription(java.lang.String description)
public void connectToServerAtStartup(java.lang.String host, int port)
public void connectToServer(GuiScreen guiMultiplayer, ServerData serverEntry)
public void connectToRealmsServer(java.lang.String host, int port)
public void setPlayClient(NetHandlerPlayClient netHandlerPlayClient)
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, java.util.Set<java.lang.String> channelSet, java.lang.String channel, Side side)
fireNetRegistrationEvent
in interface IFMLSidedHandler
public boolean shouldAllowPlayerLogins()
shouldAllowPlayerLogins
in interface IFMLSidedHandler
public void allowLogins()
allowLogins
in interface IFMLSidedHandler
public IThreadListener getWorldThread(INetHandler net)
getWorldThread
in interface IFMLSidedHandler
public void trackMissingTexture(ResourceLocation resourceLocation)
public void trackBrokenTexture(ResourceLocation resourceLocation, java.lang.String error)
public void logMissingTextureErrors()
public void processWindowMessages()
processWindowMessages
in interface IFMLSidedHandler
public java.lang.String stripSpecialChars(java.lang.String message)
stripSpecialChars
in interface IFMLSidedHandler
public void reloadRenderers()
reloadRenderers
in interface IFMLSidedHandler
public void fireSidedRegistryEvents()
fireSidedRegistryEvents
in interface IFMLSidedHandler
public CompoundDataFixer getDataFixer()
getDataFixer
in interface IFMLSidedHandler
public boolean isDisplayVSyncForced()
isDisplayVSyncForced
in interface IFMLSidedHandler
public void resetClientRecipeBook()
resetClientRecipeBook
in interface IFMLSidedHandler
public void reloadSearchTrees()
reloadSearchTrees
in interface IFMLSidedHandler
public void reloadCreativeSettings()
reloadCreativeSettings
in interface IFMLSidedHandler
private CloudRenderer getCloudRenderer()
public void updateCloudSettings()
public boolean renderClouds(int cloudTicks, float partialTicks)
public void refreshResources(IResourceType... inclusion)
public void refreshResources(java.util.function.Predicate<IResourceType> resourcePredicate)
public com.google.common.util.concurrent.ListenableFuture<java.lang.Object> scheduleResourcesRefresh(IResourceType... inclusion)
public com.google.common.util.concurrent.ListenableFuture<java.lang.Object> scheduleResourcesRefresh(java.util.function.Predicate<IResourceType> resourcePredicate)