类 RegisterGameTestsEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.RegisterGameTestsEvent
所有已实现的接口:
IModBusEvent

public class RegisterGameTestsEvent extends net.minecraftforge.eventbus.api.Event implements IModBusEvent
Game tests are registered on client or server startup. It is only run once for a given instance of the game if ForgeGameTestHooks.isGametestEnabled() returns true. This is the preferred way to register your game tests.

Fired on the Mod bus, see IModBusEvent.

  • 嵌套类概要

    从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private final Set<Method>
     
  • 构造器概要

    构造器
    构造器
    说明
    RegisterGameTestsEvent(Set<Method> gameTestMethods)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    register(Class<?> testClass)
    Registers an entire class to the game test registry.
    void
    register(Method testMethod)
    Registers a single method to the game test registry.

    从类继承的方法 net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • gameTestMethods

      private final Set<Method> gameTestMethods
  • 构造器详细资料

    • RegisterGameTestsEvent

      public RegisterGameTestsEvent(Set<Method> gameTestMethods)
  • 方法详细资料

    • register

      public void register(Class<?> testClass)
      Registers an entire class to the game test registry. All methods annotated with GameTest or GameTestGenerator will be registered. If the set of enabled batches is non-empty, a method will only be registered if its batch is listed.
      参数:
      testClass - the test class to register to the game test registry
    • register

      public void register(Method testMethod)
      Registers a single method to the game test registry. The method will only be registered if it is annotated with GameTest or GameTestGenerator. If the set of enabled batches is non-empty, the method will only be registered if its batch is listed.
      参数:
      testMethod - the test method to register to the game test registry