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 ClassesNested classes/interfaces inherited from interface net.neoforged.testframework.impl.MutableTestFramework
MutableTestFramework.MutableTestsNested classes/interfaces inherited from interface net.neoforged.testframework.TestFramework
TestFramework.Tests -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable FrameworkClientprivate @UnknownNullability Stringprivate final FrameworkConfigurationprivate @UnknownNullability net.neoforged.fml.ModContainer(package private) static final Set<TestFrameworkImpl> private final ResourceLocationprivate final org.slf4j.Loggerprivate @UnknownNullability net.neoforged.bus.api.IEventBusprivate @Nullable MinecraftServerprivate final DynamicStructureTemplatesprivate final TestFrameworkImpl.TestsImplFields inherited from interface net.neoforged.testframework.impl.MutableTestFramework
REFERENCE_CODEC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcapitaliseWords(String string, String splitOn) voidchangeStatus(Test test, Test.Status newStatus, @Nullable Entity changer) Changes the status of a test.collectTests(net.neoforged.fml.ModContainer container) net.neoforged.fml.ModContainerReturns the mod container bus linked to this framework.Returns a registrar for in-code structure templates.id()Returns the ID of this framework instance.voidinit(net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container) org.slf4j.Loggerlogger()Returns this framework's logger.net.neoforged.bus.api.IEventBusReturns the mod event bus linked to this framework.private voidprocessSummary(TestSummary summary) voidregisterCommands(com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> node) private voidsendPacketIfOn(@Nullable Runnable onServer, @Nullable Runnable remoteClient, @Nullable Runnable singlePlayer) voidsetEnabled(Test test, boolean enabled, @Nullable Entity changer) Enables or disables a test.private static voidsetupClient(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, waitMethods 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:
registerCommandsin interfaceMutableTestFramework
-
playerTestStore
- Specified by:
playerTestStorein interfaceMutableTestFramework
-
dynamicStructures
Description copied from interface:TestFrameworkReturns a registrar for in-code structure templates.- Specified by:
dynamicStructuresin interfaceTestFramework- Returns:
- a registrar for in-code structure templates
-
commandName
- Specified by:
commandNamein interfaceMutableTestFramework
-
configuration
- Specified by:
configurationin interfaceMutableTestFramework
-
init
public void init(net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container) - Specified by:
initin interfaceMutableTestFramework
-
setupClient
private static void setupClient(TestFrameworkImpl impl, net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container) -
collectTests
- Specified by:
collectTestsin interfaceMutableTestFramework
-
modEventBus
public net.neoforged.bus.api.IEventBus modEventBus()Description copied from interface:TestFrameworkReturns the mod event bus linked to this framework.- Specified by:
modEventBusin interfaceTestFramework- Returns:
- the mod event bus linked to this framework
-
container
public net.neoforged.fml.ModContainer container()Description copied from interface:TestFrameworkReturns the mod container bus linked to this framework.- Specified by:
containerin interfaceTestFramework- Returns:
- the mod container bus linked to this framework
-
id
Description copied from interface:TestFrameworkReturns the ID of this framework instance.- Specified by:
idin interfaceTestFramework- Returns:
- the ID of this framework instance
-
logger
public org.slf4j.Logger logger()Description copied from interface:TestFrameworkReturns this framework's logger.- Specified by:
loggerin interfaceTestFramework- Returns:
- this framework's logger
-
tests
Description copied from interface:TestFrameworkReturns the Tests instance of this framework.- Specified by:
testsin interfaceMutableTestFramework- Specified by:
testsin interfaceTestFramework- Returns:
- the Tests instance of this framework
-
changeStatus
Description copied from interface:TestFrameworkChanges the status of a test.- Specified by:
changeStatusin 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:TestFrameworkEnables or disables a test.- Specified by:
setEnabledin interfaceTestFramework- Parameters:
test- the test to enable/disableenabled-trueif to enable,falseif to disablechanger- the entity that changed the status of the test. Usually the player which runs the enable command
-
sendPacketIfOn
-
capitaliseWords
-