YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
cpw.mods.fml.common.Loader Class Reference

Public Member Functions

List< ModContainergetModList ()
 
void loadMods ()
 
File getConfigDir ()
 
String getCrashInformation ()
 
String getFMLVersionString ()
 
ClassLoader getModClassLoader ()
 
void computeDependencies (String dependencyString, Set< ArtifactVersion > requirements, List< ArtifactVersion > dependencies, List< ArtifactVersion > dependants)
 
Map< String, ModContainergetIndexedModList ()
 
void initializeMods ()
 
ICrashCallable getCallableCrashInformation ()
 
List< ModContainergetActiveModList ()
 
ModState getModState (ModContainer selectedMod)
 
String getMCVersionString ()
 
boolean serverStarting (Object server)
 
void serverStarted ()
 
void serverStopping ()
 
BiMap< ModContainer, Object > getModObjectList ()
 
BiMap< Object, ModContainergetReversedModObjectList ()
 
ModContainer activeModContainer ()
 
boolean isInState (LoaderState state)
 
MinecraftDummyContainer getMinecraftModContainer ()
 
boolean hasReachedState (LoaderState state)
 
String getMCPVersionString ()
 
void serverStopped ()
 
boolean serverAboutToStart (Object server)
 
Map< String, String > getFMLBrandingProperties ()
 

Static Public Member Functions

static Loader instance ()
 
static void injectData (Object...data)
 
static boolean isModLoaded (String modname)
 

Detailed Description

The loader class performs the actual loading of the mod code from disk.

There are several LoaderStates to mod loading, triggered in two different stages from the FML handler code's hooks into the minecraft code.

  1. LOADING. Scanning the filesystem for mod containers to load (zips, jars, directories), adding them to the modClassLoader Scanning, the loaded containers for mod classes to load and registering them appropriately.
  2. PREINIT. The mod classes are configured, they are sorted into a load order, and instances of the mods are constructed.
  3. INIT. The mod instances are initialized. For BaseMod mods, this involves calling the load method.
  4. POSTINIT. The mod instances are post initialized. For BaseMod mods this involves calling the modsLoaded method.
  5. UP. The Loader is complete
  6. ERRORED. The loader encountered an error during the LOADING phase and dropped to this state instead. It will not complete loading from this state, but it attempts to continue loading before abandoning and giving a fatal error.

Phase 1 code triggers the LOADING and PREINIT states. Phase 2 code triggers the INIT and POSTINIT states.

Author
cpw

Member Function Documentation

ModContainer cpw.mods.fml.common.Loader.activeModContainer ( )
void cpw.mods.fml.common.Loader.computeDependencies ( String  dependencyString,
Set< ArtifactVersion requirements,
List< ArtifactVersion dependencies,
List< ArtifactVersion dependants 
)
List<ModContainer> cpw.mods.fml.common.Loader.getActiveModList ( )
ICrashCallable cpw.mods.fml.common.Loader.getCallableCrashInformation ( )
File cpw.mods.fml.common.Loader.getConfigDir ( )
String cpw.mods.fml.common.Loader.getCrashInformation ( )
Map<String,String> cpw.mods.fml.common.Loader.getFMLBrandingProperties ( )
String cpw.mods.fml.common.Loader.getFMLVersionString ( )
Map<String,ModContainer> cpw.mods.fml.common.Loader.getIndexedModList ( )
String cpw.mods.fml.common.Loader.getMCPVersionString ( )
String cpw.mods.fml.common.Loader.getMCVersionString ( )
MinecraftDummyContainer cpw.mods.fml.common.Loader.getMinecraftModContainer ( )
ClassLoader cpw.mods.fml.common.Loader.getModClassLoader ( )
List<ModContainer> cpw.mods.fml.common.Loader.getModList ( )
BiMap<ModContainer, Object> cpw.mods.fml.common.Loader.getModObjectList ( )
ModState cpw.mods.fml.common.Loader.getModState ( ModContainer  selectedMod)
BiMap<Object, ModContainer> cpw.mods.fml.common.Loader.getReversedModObjectList ( )
boolean cpw.mods.fml.common.Loader.hasReachedState ( LoaderState  state)
void cpw.mods.fml.common.Loader.initializeMods ( )
static void cpw.mods.fml.common.Loader.injectData ( Object...  data)
static
static Loader cpw.mods.fml.common.Loader.instance ( )
static
boolean cpw.mods.fml.common.Loader.isInState ( LoaderState  state)
static boolean cpw.mods.fml.common.Loader.isModLoaded ( String  modname)
static

Query if we know of a mod named modname

Parameters
modname
Returns
If the mod is loaded
void cpw.mods.fml.common.Loader.loadMods ( )

Called from the hook to start mod loading. We trigger the identifyMods() and Constructing, Preinitalization, and Initalization phases here. Finally, the mod list is frozen completely and is consider immutable from then on.

boolean cpw.mods.fml.common.Loader.serverAboutToStart ( Object  server)
void cpw.mods.fml.common.Loader.serverStarted ( )
boolean cpw.mods.fml.common.Loader.serverStarting ( Object  server)
void cpw.mods.fml.common.Loader.serverStopped ( )
void cpw.mods.fml.common.Loader.serverStopping ( )

The documentation for this class was generated from the following file: