类 BaseCapability<T,C extends @Nullable Object>

java.lang.Object
net.neoforged.neoforge.capabilities.BaseCapability<T,C>
类型参数:
T - Type of queried objects.
C - Type of the additional context.
直接已知子类:
BlockCapability, EntityCapability, ItemCapability

public abstract class BaseCapability<T,C extends @Nullable Object> extends Object
Base class to reuse code common between most/all *Capability implementation.

This is only relevant for authors of new capability types (i.e. which are not blocks, entities, or items). Otherwise, use one of the subclasses directly.

  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • name

      public final ResourceLocation name()
      返回 the name of this capability。
      返回:
      the name of this capability
    • typeClass

      public final Class<T> typeClass()
      返回 the type of queried objects。
      返回:
      the type of queried objects
    • contextClass

      public final Class<C> contextClass()
      返回 the type of the additional context。
      返回:
      the type of the additional context