Class ForgeFeature
java.lang.Object
net.neoforged.neoforgespi.locating.ForgeFeature
ForgeFeature is a simple test for mods for the presence of specific features
such as OpenGL of a specific version or better or whatever.
This will be tested during early mod loading against lists of features in the mods.toml file for mods. Those
that are absent or out of range will be rejected.
ForgeFeature.registerFeature("openGLVersion", VersionFeatureTest.forVersionString(IModInfo.DependencySide.CLIENT, "3.2"));
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
A Bound, from a mods.toml filestatic interface
private static final record
static final record
Version based feature test. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map
<String, ForgeFeature.IFeatureTest<?>> private static final ForgeFeature.MissingFeatureTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
featureValue
(ForgeFeature.Bound bound) static <T> void
registerFeature
(String featureName, ForgeFeature.IFeatureTest<T> featureTest) static boolean
testFeature
(net.neoforged.api.distmarker.Dist side, ForgeFeature.Bound bound)
-
Field Details
-
features
-
MISSING
-
-
Constructor Details
-
ForgeFeature
private ForgeFeature()
-
-
Method Details
-
registerFeature
public static <T> void registerFeature(String featureName, ForgeFeature.IFeatureTest<T> featureTest) -
testFeature
-
featureValue
-