Package net.neoforged.testframework.impl
Class FrameworkCollectors
java.lang.Object
net.neoforged.testframework.impl.FrameworkCollectors
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Predicate
<net.neoforged.neoforgespi.language.ModFileScanData.AnnotationData> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindMethodsWithAnnotation
(net.neoforged.fml.ModContainer container, Predicate<net.neoforged.neoforgespi.language.ModFileScanData.AnnotationData> annotationPredicate, Class<? extends Annotation> annotation) static void
groupsWithAnnotation
(net.neoforged.fml.ModContainer container, Consumer<FrameworkCollectors.GroupData> consumer) Collects group information from string fields annotated withTestGroup
.static com.google.common.collect.SetMultimap
<OnInit.Stage, Consumer<MutableTestFramework>> onInitMethodsWithAnnotation
(net.neoforged.fml.ModContainer container) This method collects init listeners based on static methods accepting exactly one parameter of MutableTestFramework (or parent interfaces).static void
templatesWithAnnotation
(net.neoforged.fml.ModContainer container, BiConsumer<ResourceLocation, Supplier<StructureTemplate>> acceptor) This method collects structure templates based on static fields containing either aStructureTemplate
, aSupplier
of StructureTemplate or aStructureTemplateBuilder
, annotated withRegisterStructureTemplate
.
-
Field Details
-
SIDE_FILTER
private static final Predicate<net.neoforged.neoforgespi.language.ModFileScanData.AnnotationData> SIDE_FILTER
-
-
Constructor Details
-
FrameworkCollectors
public FrameworkCollectors()
-
-
Method Details
-
onInitMethodsWithAnnotation
public static com.google.common.collect.SetMultimap<OnInit.Stage,Consumer<MutableTestFramework>> onInitMethodsWithAnnotation(net.neoforged.fml.ModContainer container) This method collects init listeners based on static methods accepting exactly one parameter of MutableTestFramework (or parent interfaces). -
templatesWithAnnotation
public static void templatesWithAnnotation(net.neoforged.fml.ModContainer container, BiConsumer<ResourceLocation, Supplier<StructureTemplate>> acceptor) This method collects structure templates based on static fields containing either aStructureTemplate
, aSupplier
of StructureTemplate or aStructureTemplateBuilder
, annotated withRegisterStructureTemplate
. -
groupsWithAnnotation
public static void groupsWithAnnotation(net.neoforged.fml.ModContainer container, Consumer<FrameworkCollectors.GroupData> consumer) Collects group information from string fields annotated withTestGroup
. -
findMethodsWithAnnotation
public static Stream<Method> findMethodsWithAnnotation(net.neoforged.fml.ModContainer container, Predicate<net.neoforged.neoforgespi.language.ModFileScanData.AnnotationData> annotationPredicate, Class<? extends Annotation> annotation)
-