接口 DynamicTest
-
嵌套类概要
嵌套类从接口继承的嵌套类/接口 net.neoforged.testframework.Test
Test.EventListenerGroup, Test.Result, Test.Status, Test.Visuals
-
方法概要
修饰符和类型方法说明返回 a computed mod id based on this test's ID。返回 a listener group used to subscribe to events when the test is enabled。default void
Marks this test as failed.返回 the framework this test is linked to。boolean
返回 if this test is currently running as a GameTest。<T extends GameTestHelper>
voidonGameTest
(Class<T> helperType, Consumer<T> consumer) Registers a listener to run when the GameTest version of this test is run.default void
onGameTest
(Consumer<ExtendedGameTestHelper> consumer) Registers a listener to run when the GameTest version of this test is run.default void
pass()
Marks this test as passed.default void
Register the template for this game test.default void
Register the template for this game test.返回 a new registration helper with a computed mod ID。registrationHelper
(String modId) 返回 a new registration helper with the givenmodId
。void
requestConfirmation
(Player player, Component message) Requests a confirmation of the test passing from a player.default Test.Status
status()
返回 the status of this test。default void
updateStatus
(Test.Status newStatus, @Nullable Entity updater) Updates the status of the test.void
whenDisabled
(Runnable whenDisabled) Registers a listener to run when this test is disabled.void
whenEnabled
(DynamicTest.EnabledListener whenEnabled) Registers a listener to run when this test is enabled.从接口继承的方法 net.neoforged.testframework.Test
asGameTest, enabledByDefault, groups, id, init, listeners, onDisabled, onEnabled, resolveAll, resolveAsStream, visuals
-
方法详细资料
-
framework
TestFramework framework()返回 the framework this test is linked to。- 返回:
- the framework this test is linked to
-
status
返回 the status of this test。- 返回:
- the status of this test
-
updateStatus
Updates the status of the test.- 参数:
newStatus
- the new statusupdater
- the entity which updated the status
-
pass
default void pass()Marks this test as passed. -
fail
Marks this test as failed.- 参数:
message
- additional information explaining why the test failed
-
whenEnabled
Registers a listener to run when this test is enabled.- 参数:
whenEnabled
- the listener
-
eventListeners
Test.EventListenerGroup eventListeners()返回 a listener group used to subscribe to events when the test is enabled。- 返回:
- a listener group used to subscribe to events when the test is enabled
- 另请参阅:
-
whenDisabled
Registers a listener to run when this test is disabled.- 参数:
whenDisabled
- the listener
-
onGameTest
Registers a listener to run when the GameTest version of this test is run.- 参数:
consumer
- the listener
-
onGameTest
Registers a listener to run when the GameTest version of this test is run.- 参数:
helperType
- the type to use for the helperconsumer
- the listener
-
registerGameTestTemplate
Register the template for this game test.- 参数:
builder
- the builder of the template
-
registerGameTestTemplate
Register the template for this game test.- 参数:
builder
- a supplier of the builder of the template
-
registrationHelper
返回 a new registration helper with the givenmodId
。- 返回:
- a new registration helper with the given
modId
-
registrationHelper
RegistrationHelper registrationHelper()返回 a new registration helper with a computed mod ID。- 返回:
- a new registration helper with a computed mod ID
-
createModId
String createModId()返回 a computed mod id based on this test's ID。- 返回:
- a computed mod id based on this test's ID
-
isDuringGameTest
boolean isDuringGameTest()返回 if this test is currently running as a GameTest。- 返回:
- if this test is currently running as a GameTest
-
requestConfirmation
Requests a confirmation of the test passing from a player.- 参数:
player
- the player to request the confirmation frommessage
- the confirmation message
-