Package net.neoforged.neoforge.event
Class RegisterGameTestsEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.RegisterGameTestsEvent
- All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
public class RegisterGameTestsEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.fml.event.IModBusEvent
Game tests are registered on client or server startup.
It is only run once for a given instance of the game if
GameTestHooks.isGametestEnabled()
returns true.
This is the preferred way to register your game tests.
Fired on the Mod bus, see IModBusEvent
.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
gameTestMethods
-
-
Constructor Details
-
RegisterGameTestsEvent
-
-
Method Details
-
register
Registers an entire class to the game test registry. All methods annotated withGameTest
orGameTestGenerator
will be registered. If the set of enabled namespaces is non-empty, a method will only be registered if itstemplate namespace
is in an enabled namespace.- Parameters:
testClass
- the test class to register to the game test registry
-
register
Registers a single method to the game test registry. The method will only be registered if it is annotated withGameTest
orGameTestGenerator
. If the set of enabled namespaces is non-empty, the method will only be registered if itstemplate namespace
is an enabled namespace.- Parameters:
testMethod
- the test method to register to the game test registry
-