Class MethodBasedEventTest

All Implemented Interfaces:
DynamicTest, Groupable, Test

public class MethodBasedEventTest extends AbstractTest.Dynamic
  • Field Details

    • handle

      protected MethodHandle handle
    • method

      private final Method method
    • eventClass

      private final Class<? extends net.neoforged.bus.api.Event> 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

      public MethodBasedEventTest(Method method)
  • Method Details

    • bindTo

      public MethodBasedEventTest bindTo(Object target)
    • onEnabled

      public void onEnabled(Test.EventListenerGroup buses)
      Description copied from interface: Test
      This method is called when this test is enabled.
      Specified by:
      onEnabled in interface Test
      Overrides:
      onEnabled in class AbstractTest.Dynamic
      Parameters:
      buses - a collector for event listeners. Prefer using this listener instead of the casual IEventBus.addListener(Consumer) or IEventBus.register(Object), as the collector will automatically unregister listeners when the test is disabled