Package net.neoforged.testframework.impl
Class TestFrameworkImpl
java.lang.Object
net.neoforged.testframework.impl.TestFrameworkImpl
- All Implemented Interfaces:
MutableTestFramework
,TestFramework
@Internal
@ParametersAreNonnullByDefault
public class TestFrameworkImpl
extends Object
implements MutableTestFramework
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.neoforged.testframework.impl.MutableTestFramework
MutableTestFramework.MutableTests
Nested classes/interfaces inherited from interface net.neoforged.testframework.TestFramework
TestFramework.Tests
-
Field Summary
Modifier and TypeFieldDescriptionprivate final @Nullable FrameworkClient
private @UnknownNullability String
private final FrameworkConfiguration
private @UnknownNullability net.neoforged.fml.ModContainer
(package private) static final Set
<TestFrameworkImpl> private final ResourceLocation
private final org.slf4j.Logger
private @UnknownNullability net.neoforged.bus.api.IEventBus
private @Nullable MinecraftServer
private final DynamicStructureTemplates
private final TestFrameworkImpl.TestsImpl
Fields inherited from interface net.neoforged.testframework.impl.MutableTestFramework
REFERENCE_CODEC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
capitaliseWords
(String string, String splitOn) void
changeStatus
(Test test, Test.Status newStatus, @Nullable Entity changer) Changes the status of a test.collectTests
(net.neoforged.fml.ModContainer container) net.neoforged.fml.ModContainer
Returns the mod container bus linked to this framework.Returns a registrar for in-code structure templates.id()
Returns the ID of this framework instance.void
init
(net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container) org.slf4j.Logger
logger()
Returns this framework's logger.net.neoforged.bus.api.IEventBus
Returns the mod event bus linked to this framework.private void
processSummary
(TestSummary summary) void
registerCommands
(com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> node) private void
sendPacketIfOn
(@Nullable Runnable onServer, @Nullable Runnable remoteClient, @Nullable Runnable singlePlayer) void
setEnabled
(Test test, boolean enabled, @Nullable Entity changer) Enables or disables a test.private static void
setupClient
(TestFrameworkImpl impl, net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container) tests()
Returns the Tests instance of this framework.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.impl.MutableTestFramework
buildCommand, disableCommand, enableCommand, setStatusCommand
-
Field Details
-
FRAMEWORKS
-
configuration
-
client
-
logger
private final org.slf4j.Logger logger -
id
-
tests
-
server
-
structures
-
commandName
-
modBus
private @UnknownNullability net.neoforged.bus.api.IEventBus modBus -
container
private @UnknownNullability net.neoforged.fml.ModContainer container
-
-
Constructor Details
-
TestFrameworkImpl
-
-
Method Details
-
processSummary
-
registerCommands
public void registerCommands(com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> node) - Specified by:
registerCommands
in interfaceMutableTestFramework
-
playerTestStore
- Specified by:
playerTestStore
in interfaceMutableTestFramework
-
dynamicStructures
Description copied from interface:TestFramework
Returns a registrar for in-code structure templates.- Specified by:
dynamicStructures
in interfaceTestFramework
- Returns:
- a registrar for in-code structure templates
-
commandName
- Specified by:
commandName
in interfaceMutableTestFramework
-
configuration
- Specified by:
configuration
in interfaceMutableTestFramework
-
init
public void init(net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container) - Specified by:
init
in interfaceMutableTestFramework
-
setupClient
private static void setupClient(TestFrameworkImpl impl, net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container) -
collectTests
- Specified by:
collectTests
in interfaceMutableTestFramework
-
modEventBus
public net.neoforged.bus.api.IEventBus modEventBus()Description copied from interface:TestFramework
Returns the mod event bus linked to this framework.- Specified by:
modEventBus
in interfaceTestFramework
- Returns:
- the mod event bus linked to this framework
-
container
public net.neoforged.fml.ModContainer container()Description copied from interface:TestFramework
Returns the mod container bus linked to this framework.- Specified by:
container
in interfaceTestFramework
- Returns:
- the mod container bus linked to this framework
-
id
Description copied from interface:TestFramework
Returns the ID of this framework instance.- Specified by:
id
in interfaceTestFramework
- Returns:
- the ID of this framework instance
-
logger
public org.slf4j.Logger logger()Description copied from interface:TestFramework
Returns this framework's logger.- Specified by:
logger
in interfaceTestFramework
- Returns:
- this framework's logger
-
tests
Description copied from interface:TestFramework
Returns the Tests instance of this framework.- Specified by:
tests
in interfaceMutableTestFramework
- Specified by:
tests
in interfaceTestFramework
- Returns:
- the Tests instance of this framework
-
changeStatus
Description copied from interface:TestFramework
Changes the status of a test.- Specified by:
changeStatus
in interfaceTestFramework
- Parameters:
test
- the test whose status to changenewStatus
- the status to change tochanger
- the entity that changed the status of the test. Usually the player completing a test
-
setEnabled
Description copied from interface:TestFramework
Enables or disables a test.- Specified by:
setEnabled
in interfaceTestFramework
- Parameters:
test
- the test to enable/disableenabled
-true
if to enable,false
if to disablechanger
- the entity that changed the status of the test. Usually the player which runs the enable command
-
sendPacketIfOn
-
capitaliseWords
-