类 CapabilityRegistry<C>
java.lang.Object
net.neoforged.neoforge.capabilities.CapabilityRegistry<C>
Helper class to manage registering capabilities.
You only need this if you are creating your own type (block, entity, item...) of capabilities!
Look at the source code of BlockCapability
, EntityCapability
, ... for an example.
-
嵌套类概要
嵌套类修饰符和类型类说明static interface
private static final record
-
字段概要
字段修饰符和类型字段说明private final ConcurrentMap
<ResourceLocation, CapabilityRegistry.StoredCap<C>> private final CapabilityRegistry.CapabilityConstructor
<C> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明create
(ResourceLocation name, Class<?> typeClass, Class<?> contextClass) Creates a new capability with the given name, type class and context class, or returns an existing one if it was already created.getAll()
Returns an immutable copy of all the currently known capabilities.
-
字段详细资料
-
caps
-
constructor
-
-
构造器详细资料
-
CapabilityRegistry
-
-
方法详细资料
-
create
Creates a new capability with the given name, type class and context class, or returns an existing one if it was already created.- 参数:
name
- name of the capabilitytypeClass
- class of the queried objectcontextClass
- class of the additional context- 抛出:
IllegalStateException
- if a capability with the same name but different type or context class was already created
-
getAll
Returns an immutable copy of all the currently known capabilities.
-