类 CapabilityProvider<B extends ICapabilityProviderImpl<B>>

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<B>
所有已实现的接口:
ICapabilityProvider, ICapabilityProviderImpl<B>
直接已知子类:
BlockEntity, CapabilityProvider.AsField, Entity, ItemStack, Level

@ParametersAreNonnullByDefault public abstract class CapabilityProvider<B extends ICapabilityProviderImpl<B>> extends Object implements ICapabilityProviderImpl<B>
  • 字段详细资料

    • SUPPORTS_LAZY_CAPABILITIES

      @VisibleForTesting static boolean SUPPORTS_LAZY_CAPABILITIES
    • baseClass

      @NotNull private final @NotNull Class<B extends ICapabilityProviderImpl<B>> baseClass
    • capabilities

      @Nullable private @Nullable CapabilityDispatcher capabilities
    • valid

      private boolean valid
    • isLazy

      private boolean isLazy
    • lazyParentSupplier

      private Supplier<ICapabilityProvider> lazyParentSupplier
    • lazyData

      private CompoundTag lazyData
    • registryAccess

      private HolderLookup.Provider registryAccess
    • initialized

      private boolean initialized
  • 构造器详细资料

    • CapabilityProvider

      protected CapabilityProvider(Class<B> baseClass)
    • CapabilityProvider

      protected CapabilityProvider(Class<B> baseClass, boolean isLazy)
  • 方法详细资料

    • gatherCapabilities

      protected final void gatherCapabilities()
    • gatherCapabilities

      protected final void gatherCapabilities(@Nullable @Nullable ICapabilityProvider parent)
    • gatherCapabilities

      protected final void gatherCapabilities(@Nullable @Nullable Supplier<ICapabilityProvider> parent)
    • doGatherCapabilities

      private void doGatherCapabilities(@Nullable @Nullable ICapabilityProvider parent)
    • getProvider

      @NotNull B getProvider()
    • getCapabilities

      @Nullable protected final @Nullable CapabilityDispatcher getCapabilities()
    • serializeCaps

      @Nullable protected final @Nullable CompoundTag serializeCaps(HolderLookup.Provider registryAccess)
    • deserializeCaps

      protected final void deserializeCaps(HolderLookup.Provider registryAccess, CompoundTag tag)
    • invalidateCaps

      public void invalidateCaps()
      指定者:
      invalidateCaps 在接口中 ICapabilityProviderImpl<B extends ICapabilityProviderImpl<B>>
    • reviveCaps

      public void reviveCaps()
      指定者:
      reviveCaps 在接口中 ICapabilityProviderImpl<B extends ICapabilityProviderImpl<B>>
    • getCapability

      @NotNull public <T> @NotNull LazyOptional<T> getCapability(@NotNull @NotNull Capability<T> cap, @Nullable @Nullable Direction side)
      从接口复制的说明: ICapabilityProvider
      Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.
      指定者:
      getCapability 在接口中 ICapabilityProvider
      参数:
      cap - The capability to check
      side - The Side to check from, CAN BE NULL. Null is defined to represent 'internal' or 'self'
      返回:
      The requested an optional holding the requested capability.