[1.18] Integrate the gametest framework with Forge (#8225)

Signed-off-by: SizableShrimp <[email protected]>
This commit is contained in:
SizableShrimp authored and GitHub committed 2022-02-25 01:06:32 +00:00
1 parent bb547a5748
commit f0c2554b1c
28 files changed
+944 -8

No files matched your search

@@ -0,0 +1,33 @@
package net.minecraftforge.gametest;
import net.minecraft.gametest.framework.GameTest;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* When used on a class, this sets the default state for whether
* to prefix any contained game test templates with the {@link Class#getSimpleName() simple class name} or not.
* <p>
* When used on a method, this defines whether the specific method should be prefixed with the simple class name or not.
* <p>
* If this annotation cannot be found on a game test method or its containing class, the default behavior is to prefix the class name.
* <p>
* Method annotations override any class annotations.
*
* @see GameTestHolder
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface PrefixGameTestTemplate
{
/**
* Whether to prefix the game test template with the containing class' {@link Class#getSimpleName() simple name}.
* For example, true in a class named "MyTest" would result in "mytest.structure" while false would result in "structure".
* <p>
* Only applies to methods annotated with {@link GameTest}.
*/
boolean value() default true;
}