Class MethodBasedEventTest
java.lang.Object
net.neoforged.testframework.impl.test.AbstractTest
net.neoforged.testframework.impl.test.AbstractTest.Dynamic
net.neoforged.testframework.impl.test.MethodBasedEventTest
- All Implemented Interfaces:
DynamicTest
,Groupable
,Test
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.testframework.impl.test.AbstractTest
AbstractTest.AnnotationHolder, AbstractTest.Dynamic
Nested classes/interfaces inherited from interface net.neoforged.testframework.DynamicTest
DynamicTest.EnabledListener
Nested classes/interfaces inherited from interface net.neoforged.testframework.Test
Test.EventListenerGroup, Test.Result, Test.Status, Test.Visuals
-
Field Summary
Modifier and TypeFieldDescriptionprivate final net.neoforged.fml.common.Mod.EventBusSubscriber.Bus
private final Class<? extends net.neoforged.bus.api.Event>
protected MethodHandle
private final Method
private final net.neoforged.bus.api.EventPriority
private final boolean
Fields inherited from class net.neoforged.testframework.impl.test.AbstractTest
enabledByDefault, framework, gameTestData, groups, id, listeners, visuals
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onEnabled
(Test.EventListenerGroup buses) This method is called when this test is enabled.Methods inherited from class net.neoforged.testframework.impl.test.AbstractTest.Dynamic
createModId, eventListeners, fail, framework, gameTestTemplate, isDuringGameTest, onDisabled, onGameTest, onGameTest, pass, registrationHelper, registrationHelper, whenDisabled, whenEnabled
Methods inherited from class net.neoforged.testframework.impl.test.AbstractTest
asGameTest, configureFrom, configureGameTest, enable, enabledByDefault, groups, id, init, isEnabled, listeners, logger, requestConfirmation, status, updateStatus, visuals
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.testframework.DynamicTest
registerGameTestTemplate, registerGameTestTemplate, requestConfirmation, status, updateStatus
Methods inherited from interface net.neoforged.testframework.Test
asGameTest, enabledByDefault, groups, id, init, listeners, resolveAll, resolveAsStream, visuals
-
Field Details
-
handle
-
method
-
eventClass
-
bus
private final net.neoforged.fml.common.Mod.EventBusSubscriber.Bus bus -
priority
private final net.neoforged.bus.api.EventPriority priority -
receiveCancelled
private final boolean receiveCancelled
-
-
Constructor Details
-
MethodBasedEventTest
-
-
Method Details
-
bindTo
-
onEnabled
Description copied from interface:Test
This method is called when this test is enabled.- Specified by:
onEnabled
in interfaceTest
- Overrides:
onEnabled
in classAbstractTest.Dynamic
- Parameters:
buses
- a collector for event listeners. Prefer using this listener instead of the casualIEventBus.addListener(Consumer)
orIEventBus.register(Object)
, as the collector will automatically unregister listeners when the test is disabled
-