public enum CapabilityManager extends java.lang.Enum<CapabilityManager>
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Field and Description |
---|---|
private java.util.IdentityHashMap<java.lang.String,java.util.List<java.util.function.Function<Capability<?>,java.lang.Object>>> |
callbacks |
private static org.objectweb.asm.Type |
CAP_INJECT |
private static org.apache.logging.log4j.Logger |
LOGGER |
private java.util.IdentityHashMap<java.lang.String,Capability<?>> |
providers |
Modifier and Type | Method and Description |
---|---|
private static void |
attachCapabilityToMethod(java.util.Map<java.lang.String,java.util.List<java.util.function.Function<Capability<?>,java.lang.Object>>> cbs,
net.minecraftforge.forgespi.language.ModFileScanData.AnnotationData entry) |
void |
injectCapabilities(java.util.List<net.minecraftforge.forgespi.language.ModFileScanData> data) |
<T> void |
register(java.lang.Class<T> type,
Capability.IStorage<T> storage,
java.util.concurrent.Callable<? extends T> factory)
Registers a capability to be consumed by others.
|
static CapabilityManager |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CapabilityManager[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CapabilityManager INSTANCE
private static final org.apache.logging.log4j.Logger LOGGER
private static final org.objectweb.asm.Type CAP_INJECT
private final java.util.IdentityHashMap<java.lang.String,Capability<?>> providers
private volatile java.util.IdentityHashMap<java.lang.String,java.util.List<java.util.function.Function<Capability<?>,java.lang.Object>>> callbacks
public static CapabilityManager[] values()
for (CapabilityManager c : CapabilityManager.values()) System.out.println(c);
public static CapabilityManager valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic <T> void register(java.lang.Class<T> type, Capability.IStorage<T> storage, java.util.concurrent.Callable<? extends T> factory)
type
- The Interface to be registeredstorage
- A default implementation of the storage handler.factory
- A Factory that will produce new instances of the default implementation.public void injectCapabilities(java.util.List<net.minecraftforge.forgespi.language.ModFileScanData> data)
private static void attachCapabilityToMethod(java.util.Map<java.lang.String,java.util.List<java.util.function.Function<Capability<?>,java.lang.Object>>> cbs, net.minecraftforge.forgespi.language.ModFileScanData.AnnotationData entry)