public abstract class ModContainer
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
protected java.util.Optional<java.util.function.Consumer<ModConfig.ModConfigEvent>> |
configHandler |
protected java.util.EnumMap<ModConfig.Type,ModConfig> |
configs |
protected java.util.function.Supplier<?> |
contextExtension |
protected java.util.Map<ExtensionPoint,java.util.function.Supplier<?>> |
extensionPoints |
protected java.lang.String |
modId |
protected net.minecraftforge.forgespi.language.IModInfo |
modInfo |
protected ModLoadingStage |
modLoadingStage |
protected java.lang.String |
namespace |
protected java.util.Map<ModLoadingStage,java.util.function.Consumer<LifecycleEventProvider.LifecycleEvent>> |
triggerMap |
Constructor and Description |
---|
ModContainer(net.minecraftforge.forgespi.language.IModInfo info) |
Modifier and Type | Method and Description |
---|---|
protected void |
acceptEvent(net.minecraftforge.eventbus.api.Event e)
Accept an arbitrary event for processing by the mod.
|
void |
addConfig(ModConfig modConfig) |
void |
dispatchConfigEvent(ModConfig.ModConfigEvent event) |
ModLoadingStage |
getCurrentState() |
<T> java.util.Optional<T> |
getCustomExtension(ExtensionPoint<T> point) |
abstract java.lang.Object |
getMod() |
java.lang.String |
getModId() |
net.minecraftforge.forgespi.language.IModInfo |
getModInfo() |
java.lang.String |
getNamespace() |
abstract boolean |
matches(java.lang.Object mod)
Does this mod match the supplied mod?
|
<T> void |
registerExtensionPoint(ExtensionPoint<T> point,
java.util.function.Supplier<T> extension) |
void |
transitionState(LifecycleEventProvider.LifecycleEvent event,
java.util.function.Consumer<java.util.List<ModLoadingException>> errorHandler)
Transition the mod to this event if possible.
|
protected final java.lang.String modId
protected final java.lang.String namespace
protected final net.minecraftforge.forgespi.language.IModInfo modInfo
protected ModLoadingStage modLoadingStage
protected java.util.function.Supplier<?> contextExtension
protected final java.util.Map<ModLoadingStage,java.util.function.Consumer<LifecycleEventProvider.LifecycleEvent>> triggerMap
protected final java.util.Map<ExtensionPoint,java.util.function.Supplier<?>> extensionPoints
protected final java.util.EnumMap<ModConfig.Type,ModConfig> configs
protected java.util.Optional<java.util.function.Consumer<ModConfig.ModConfigEvent>> configHandler
public ModContainer(net.minecraftforge.forgespi.language.IModInfo info)
public final java.lang.String getModId()
public final java.lang.String getNamespace()
public ModLoadingStage getCurrentState()
public final void transitionState(LifecycleEventProvider.LifecycleEvent event, java.util.function.Consumer<java.util.List<ModLoadingException>> errorHandler)
event
- to transition topublic net.minecraftforge.forgespi.language.IModInfo getModInfo()
public <T> java.util.Optional<T> getCustomExtension(ExtensionPoint<T> point)
public <T> void registerExtensionPoint(ExtensionPoint<T> point, java.util.function.Supplier<T> extension)
public void addConfig(ModConfig modConfig)
public void dispatchConfigEvent(ModConfig.ModConfigEvent event)
public abstract boolean matches(java.lang.Object mod)
mod
- to comparepublic abstract java.lang.Object getMod()
protected void acceptEvent(net.minecraftforge.eventbus.api.Event e)
e
- Event to accept