public class ModLoader
extends java.lang.Object
#loadMods()
and #finishMods()
Overall sequence for loadMods is:
Mod.EventBusSubscriber
,
RegistryEvent
, CapabilityInject
and othersFMLCommonSetupEvent
to modsFMLClientSetupEvent
or
FMLDedicatedServerSetupEvent
to modsInterModEnqueueEvent
to mods,
for enqueuing InterModComms
messages for other mods to receive subsequentlyInterModProcessEvent
to mods,
for processing InterModComms
messages received from other mods prior to this eventFMLLoadCompleteEvent
to mods,
and completes the mod loading sequence.Modifier and Type | Class and Description |
---|---|
private static class |
ModLoader.SpacedRunnable |
Modifier and Type | Field and Description |
---|---|
private GatherDataEvent.DataGeneratorConfig |
dataGeneratorConfig |
private ExistingFileHelper |
existingFileHelper |
private static ModLoader |
INSTANCE |
private cpw.mods.modlauncher.TransformingClassLoader |
launchClassLoader |
private java.util.List<ModLoadingException> |
loadingExceptions |
private LoadingModList |
loadingModList |
private java.util.List<ModLoadingWarning> |
loadingWarnings |
private static org.apache.logging.log4j.Logger |
LOGGER |
private java.util.Optional<java.util.function.Consumer<java.lang.String>> |
statusConsumer |
Modifier | Constructor and Description |
---|---|
private |
ModLoader() |
Modifier and Type | Method and Description |
---|---|
private void |
accumulateErrors(java.util.List<ModLoadingException> errors) |
void |
addWarning(ModLoadingWarning warning) |
private ModContainer |
buildModContainerFromTOML(ModFile modFile,
cpw.mods.modlauncher.TransformingClassLoader modClassLoader,
java.util.Map<java.lang.String,net.minecraftforge.forgespi.language.IModInfo> modInfoMap,
java.util.Map.Entry<java.lang.String,? extends net.minecraftforge.forgespi.language.IModLanguageProvider.IModLanguageLoader> idToProviderEntry) |
private java.util.List<ModContainer> |
buildMods(ModFile modFile,
cpw.mods.modlauncher.TransformingClassLoader modClassLoader) |
private java.lang.String |
computeLanguageList() |
private java.lang.String |
computeModLauncherServiceList() |
private void |
dispatchAndHandleError(LifecycleEventProvider event,
java.util.concurrent.Executor executor,
java.lang.Runnable ticker) |
void |
finishMods(java.util.concurrent.Executor mainThreadExecutor) |
void |
gatherAndInitializeMods(java.lang.Runnable ticker) |
static ModLoader |
get() |
java.util.function.Function<ModContainer,ModLifecycleEvent> |
getDataGeneratorEvent() |
java.util.List<ModLoadingWarning> |
getWarnings() |
void |
loadMods(java.util.concurrent.Executor mainThreadExecutor,
java.util.function.Consumer<java.util.function.Consumer<java.util.function.Supplier<net.minecraftforge.eventbus.api.Event>>> preSidedRunnable,
java.util.function.Consumer<java.util.function.Consumer<java.util.function.Supplier<net.minecraftforge.eventbus.api.Event>>> postSidedRunnable) |
void |
postEvent(net.minecraftforge.eventbus.api.Event e) |
void |
runDataGenerator(java.util.Set<java.lang.String> mods,
java.nio.file.Path path,
java.util.Collection<java.nio.file.Path> inputs,
java.util.Collection<java.nio.file.Path> existingPacks,
boolean serverGenerators,
boolean clientGenerators,
boolean devToolGenerators,
boolean reportsGenerator,
boolean structureValidator)
Deprecated.
|
void |
runDataGenerator(java.util.Set<java.lang.String> mods,
java.nio.file.Path path,
java.util.Collection<java.nio.file.Path> inputs,
java.util.Collection<java.nio.file.Path> existingPacks,
boolean serverGenerators,
boolean clientGenerators,
boolean devToolGenerators,
boolean reportsGenerator,
boolean structureValidator,
boolean flat) |
private static final org.apache.logging.log4j.Logger LOGGER
private static ModLoader INSTANCE
private final cpw.mods.modlauncher.TransformingClassLoader launchClassLoader
private final LoadingModList loadingModList
private final java.util.List<ModLoadingException> loadingExceptions
private final java.util.List<ModLoadingWarning> loadingWarnings
private GatherDataEvent.DataGeneratorConfig dataGeneratorConfig
private ExistingFileHelper existingFileHelper
private final java.util.Optional<java.util.function.Consumer<java.lang.String>> statusConsumer
private java.lang.String computeLanguageList()
private java.lang.String computeModLauncherServiceList()
public static ModLoader get()
public void loadMods(java.util.concurrent.Executor mainThreadExecutor, java.util.function.Consumer<java.util.function.Consumer<java.util.function.Supplier<net.minecraftforge.eventbus.api.Event>>> preSidedRunnable, java.util.function.Consumer<java.util.function.Consumer<java.util.function.Supplier<net.minecraftforge.eventbus.api.Event>>> postSidedRunnable)
public void gatherAndInitializeMods(java.lang.Runnable ticker)
private void dispatchAndHandleError(LifecycleEventProvider event, java.util.concurrent.Executor executor, java.lang.Runnable ticker)
private void accumulateErrors(java.util.List<ModLoadingException> errors)
private java.util.List<ModContainer> buildMods(ModFile modFile, cpw.mods.modlauncher.TransformingClassLoader modClassLoader)
private ModContainer buildModContainerFromTOML(ModFile modFile, cpw.mods.modlauncher.TransformingClassLoader modClassLoader, java.util.Map<java.lang.String,net.minecraftforge.forgespi.language.IModInfo> modInfoMap, java.util.Map.Entry<java.lang.String,? extends net.minecraftforge.forgespi.language.IModLanguageProvider.IModLanguageLoader> idToProviderEntry)
public void postEvent(net.minecraftforge.eventbus.api.Event e)
public void finishMods(java.util.concurrent.Executor mainThreadExecutor)
public java.util.List<ModLoadingWarning> getWarnings()
public void addWarning(ModLoadingWarning warning)
@Deprecated public void runDataGenerator(java.util.Set<java.lang.String> mods, java.nio.file.Path path, java.util.Collection<java.nio.file.Path> inputs, java.util.Collection<java.nio.file.Path> existingPacks, boolean serverGenerators, boolean clientGenerators, boolean devToolGenerators, boolean reportsGenerator, boolean structureValidator)
public void runDataGenerator(java.util.Set<java.lang.String> mods, java.nio.file.Path path, java.util.Collection<java.nio.file.Path> inputs, java.util.Collection<java.nio.file.Path> existingPacks, boolean serverGenerators, boolean clientGenerators, boolean devToolGenerators, boolean reportsGenerator, boolean structureValidator, boolean flat)
public java.util.function.Function<ModContainer,ModLifecycleEvent> getDataGeneratorEvent()