类 CapabilityManager

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityManager

public final class CapabilityManager extends Object
  • 字段详细资料

    • INSTANCE

      @Deprecated(forRemoval=true, since="1.21") public static final CapabilityManager INSTANCE
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • AUTO_REGISTER

      private static final org.objectweb.asm.Type AUTO_REGISTER
    • providers

      private static final Map<CapabilityManager.Key,Capability<?>> providers
  • 构造器详细资料

    • CapabilityManager

      public CapabilityManager()
  • 方法详细资料

    • get

      public static <T> Capability<T> get(CapabilityToken<T> type)
      Retrieves the 'root' capability for the specified type. This is the generic one that is used when the API registers the specified type. It is also safe to assume that if your child token is a valid return when this Capability is requested.
    • get

      public static <T> Capability<T> get(CapabilityToken<T> type, String modid, String name)
      Retrieves a named capability of the specified type. This is useful when providers supply multiple instances of the same interface and want to distinguish between them. It is generally not safe to return your generic implementation for the root type when this is requested.
    • get

      public static <T> Capability<T> get(CapabilityToken<T> type, ResourceLocation name)
      Retrieves a named capability of the specified type. This is useful when providers supply multiple instances of the same interface and want to distinguish between them. It is generally not safe to return your generic implementation for the root type when this is requested.
    • get

      static <T> Capability<T> get(String type, ResourceLocation name, boolean registering)
    • injectCapabilities

      @Internal public static void injectCapabilities(ModList modlist)
    • error

      private static void error(String message)