public class Capability<T>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Capability.IStorage<T> |
Modifier and Type | Method and Description |
---|---|
<R> R |
cast(T instance)
Use this inside ICapabilityProvider.getCapability to avoid unchecked cast warnings.
|
T |
getDefaultInstance()
A NEW instance of the default implementation.
|
java.lang.String |
getName() |
Capability.IStorage<T> |
getStorage() |
void |
readNBT(T instance,
EnumFacing side,
NBTBase nbt)
Quick access to the IStorage's readNBT.
|
NBTBase |
writeNBT(T instance,
EnumFacing side)
Quick access to the IStorage's writeNBT.
|
public java.lang.String getName()
public Capability.IStorage<T> getStorage()
public void readNBT(T instance, EnumFacing side, NBTBase nbt)
Capability.IStorage.readNBT(Capability, Object, EnumFacing, NBTBase)
for documentation.public NBTBase writeNBT(T instance, EnumFacing side)
Capability.IStorage.writeNBT(Capability, Object, EnumFacing)
for documentation.public T getDefaultInstance()
public <R> R cast(T instance)