类 ModContainer
java.lang.Object
net.minecraftforge.fml.ModContainer
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.
-
字段概要
字段修饰符和类型字段说明protected final Map
<ModLoadingStage, Runnable> protected Optional
<Consumer<IConfigEvent>> 已过时, 待删除: 此 API 元素将从以后的版本中删除。protected final EnumMap
<ModConfig.Type, ModConfig> protected Supplier
<?> (专用程序包) final Set
<ModContainer> protected final Map
<Class<? extends IExtensionPoint<?>>, Supplier<?>> protected final String
protected final net.minecraftforge.forgespi.language.IModInfo
protected ModLoadingStage
protected final String
-
构造器概要
构造器构造器说明Errored container state, used for filtering.ModContainer
(net.minecraftforge.forgespi.language.IModInfo info) -
方法概要
修饰符和类型方法说明protected <T extends net.minecraftforge.eventbus.api.Event & IModBusEvent>
voidacceptEvent
(T e) Accept an arbitrary event for processing by the mod.void
void
dispatchConfigEvent
(IConfigEvent event) getCustomExtension
(Class<? extends IExtensionPoint<T>> point) abstract Object
getMod()
final String
getModId()
net.minecraftforge.forgespi.language.IModInfo
final String
abstract boolean
Does this mod match the supplied mod?void
registerDisplayTest
(String version, BiPredicate<String, Boolean> remoteVersionTest) void
registerDisplayTest
(Supplier<String> suppliedVersion, BiPredicate<String, Boolean> remoteVersionTest) void
registerDisplayTest
(Supplier<IExtensionPoint.DisplayTest> displayTest) void
registerDisplayTest
(IExtensionPoint.DisplayTest displayTest) <T extends Record & IExtensionPoint<T>>
voidregisterExtensionPoint
(Class<? extends IExtensionPoint<T>> point, Supplier<T> extension)
-
字段详细资料
-
modId
-
namespace
-
modInfo
protected final net.minecraftforge.forgespi.language.IModInfo modInfo -
modLoadingStage
-
contextExtension
-
activityMap
-
extensionPoints
-
configs
-
dependencies
-
configHandler
@Deprecated(since="1.21.3", forRemoval=true) protected Optional<Consumer<IConfigEvent>> configHandler已过时, 待删除: 此 API 元素将从以后的版本中删除。If you want to handle the event, overridedispatchConfigEvent(IConfigEvent)
-
-
构造器详细资料
-
ModContainer
public ModContainer(net.minecraftforge.forgespi.language.IModInfo info) -
ModContainer
ModContainer()Errored container state, used for filtering. Does nothing.
-
-
方法详细资料
-
getModId
- 返回:
- the modid for this mod
-
getNamespace
- 返回:
- the resource prefix for the mod
-
getCurrentState
- 返回:
- The current loading stage for this mod
-
getModInfo
public net.minecraftforge.forgespi.language.IModInfo getModInfo() -
getCustomExtension
-
registerExtensionPoint
public <T extends Record & IExtensionPoint<T>> void registerExtensionPoint(Class<? extends IExtensionPoint<T>> point, Supplier<T> extension) -
registerDisplayTest
-
registerDisplayTest
-
registerDisplayTest
-
registerDisplayTest
public void registerDisplayTest(Supplier<String> suppliedVersion, BiPredicate<String, Boolean> remoteVersionTest) -
addConfig
-
dispatchConfigEvent
-
matches
Does this mod match the supplied mod?- 参数:
mod
- to compare- 返回:
- if the mod matches
-
getMod
- 返回:
- the mod object instance
-
acceptEvent
Accept an arbitrary event for processing by the mod. Probably posted to an event bus in the lower level container.- 参数:
e
- Event to accept
-