Class TestFrameworkImpl

java.lang.Object
net.neoforged.testframework.impl.TestFrameworkImpl
All Implemented Interfaces:
MutableTestFramework, TestFramework

@Internal @ParametersAreNonnullByDefault public class TestFrameworkImpl extends Object implements MutableTestFramework
  • Field Details

  • Constructor Details

  • Method Details

    • processSummary

      private void processSummary(TestSummary summary)
    • registerCommands

      public void registerCommands(com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> node)
      Specified by:
      registerCommands in interface MutableTestFramework
    • playerTestStore

      public PlayerTestStore playerTestStore()
      Specified by:
      playerTestStore in interface MutableTestFramework
    • dynamicStructures

      public DynamicStructureTemplates dynamicStructures()
      Description copied from interface: TestFramework
      Returns a registrar for in-code structure templates.
      Specified by:
      dynamicStructures in interface TestFramework
      Returns:
      a registrar for in-code structure templates
    • commandName

      public String commandName()
      Specified by:
      commandName in interface MutableTestFramework
    • configuration

      public FrameworkConfiguration configuration()
      Specified by:
      configuration in interface MutableTestFramework
    • init

      public void init(net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container)
      Specified by:
      init in interface MutableTestFramework
    • setupClient

      private static void setupClient(TestFrameworkImpl impl, net.neoforged.bus.api.IEventBus modBus, net.neoforged.fml.ModContainer container)
    • collectTests

      public List<Test> collectTests(net.neoforged.fml.ModContainer container)
      Specified by:
      collectTests in interface MutableTestFramework
    • 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 interface TestFramework
      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 interface TestFramework
      Returns:
      the mod container bus linked to this framework
    • id

      public ResourceLocation id()
      Description copied from interface: TestFramework
      Returns the ID of this framework instance.
      Specified by:
      id in interface TestFramework
      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 interface TestFramework
      Returns:
      this framework's logger
    • tests

      Description copied from interface: TestFramework
      Returns the Tests instance of this framework.
      Specified by:
      tests in interface MutableTestFramework
      Specified by:
      tests in interface TestFramework
      Returns:
      the Tests instance of this framework
    • changeStatus

      public void changeStatus(Test test, Test.Status newStatus, @Nullable @Nullable Entity changer)
      Description copied from interface: TestFramework
      Changes the status of a test.
      Specified by:
      changeStatus in interface TestFramework
      Parameters:
      test - the test whose status to change
      newStatus - the status to change to
      changer - the entity that changed the status of the test. Usually the player completing a test
    • setEnabled

      public void setEnabled(Test test, boolean enabled, @Nullable @Nullable Entity changer)
      Description copied from interface: TestFramework
      Enables or disables a test.
      Specified by:
      setEnabled in interface TestFramework
      Parameters:
      test - the test to enable/disable
      enabled - true if to enable, false if to disable
      changer - the entity that changed the status of the test. Usually the player which runs the enable command
    • sendPacketIfOn

      private void sendPacketIfOn(@Nullable @Nullable Runnable onServer, @Nullable @Nullable Runnable remoteClient, @Nullable @Nullable Runnable singlePlayer)
    • capitaliseWords

      public static String capitaliseWords(String string, String splitOn)