Package net.minecraftforge.fml
Class ModContainer
java.lang.Object
net.minecraftforge.fml.ModContainer
- Direct Known Subclasses:
- FMLModContainer,- LowCodeModContainer,- MinecraftModContainer,- ModLoader.ErroredModContainer
The container that wraps around mods in the system.
 
The philosophy is that individual mod implementation technologies should not impact the actual loading and management of mod code. This class provides a mechanism by which we can wrap actual mod code so that the loader and other facilities can treat mods at arms length.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Map<ModLoadingStage,Runnable> protected Optional<Consumer<IConfigEvent>>protected final EnumMap<ModConfig.Type,ModConfig> protected Supplier<?>protected final Map<Class<? extends IExtensionPoint<?>>,Supplier<?>> protected final Stringprotected final net.minecraftforge.forgespi.language.IModInfoprotected ModLoadingStageprotected final String
- 
Constructor SummaryConstructorsConstructorDescriptionErrored container state, used for filtering.ModContainer(net.minecraftforge.forgespi.language.IModInfo info) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent>
 voidacceptEvent(T e) Accept an arbitrary event for processing by the mod.voidstatic <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent>
 CompletableFuture<Void>buildTransitionHandler(ModContainer target, IModStateTransition.EventGenerator<T> eventGenerator, ProgressMeter progressBar, BiFunction<ModLoadingStage, Throwable, ModLoadingStage> stateChangeHandler, Executor executor) voiddispatchConfigEvent(IConfigEvent event) getCustomExtension(Class<? extends IExtensionPoint<T>> point) abstract ObjectgetMod()final StringgetModId()net.minecraftforge.forgespi.language.IModInfofinal Stringabstract booleanDoes this mod match the supplied mod?<T extends Record & IExtensionPoint<T>>
 voidregisterExtensionPoint(Class<? extends IExtensionPoint<T>> point, Supplier<T> extension) 
- 
Field Details- 
modId
- 
namespace
- 
modInfoprotected final net.minecraftforge.forgespi.language.IModInfo modInfo
- 
modLoadingStage
- 
contextExtension
- 
activityMap
- 
extensionPoints
- 
configs
- 
configHandler
 
- 
- 
Constructor Details- 
ModContainerpublic ModContainer(net.minecraftforge.forgespi.language.IModInfo info) 
- 
ModContainerModContainer()Errored container state, used for filtering. Does nothing.
 
- 
- 
Method Details- 
getModId- Returns:
- the modid for this mod
 
- 
getNamespace- Returns:
- the resource prefix for the mod
 
- 
getCurrentState- Returns:
- The current loading stage for this mod
 
- 
buildTransitionHandlerpublic static <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent> CompletableFuture<Void> buildTransitionHandler(ModContainer target, IModStateTransition.EventGenerator<T> eventGenerator, ProgressMeter progressBar, BiFunction<ModLoadingStage, Throwable, ModLoadingStage> stateChangeHandler, Executor executor) 
- 
getModInfopublic net.minecraftforge.forgespi.language.IModInfo getModInfo()
- 
getCustomExtension
- 
registerExtensionPointpublic <T extends Record & IExtensionPoint<T>> void registerExtensionPoint(Class<? extends IExtensionPoint<T>> point, Supplier<T> extension) 
- 
addConfig
- 
dispatchConfigEvent
- 
matchesDoes this mod match the supplied mod?- Parameters:
- mod- to compare
- Returns:
- if the mod matches
 
- 
getMod- Returns:
- the mod object instance
 
- 
acceptEventAccept an arbitrary event for processing by the mod. Probably posted to an event bus in the lower level container.- Parameters:
- e- Event to accept
 
 
-