Class CapabilityFluidHandler.DefaultFluidHandlerStorage<T extends IFluidHandler>
- java.lang.Object
-
- net.minecraftforge.fluids.capability.CapabilityFluidHandler.DefaultFluidHandlerStorage<T>
-
- All Implemented Interfaces:
Capability.IStorage<T>
- Enclosing class:
- CapabilityFluidHandler
private static class CapabilityFluidHandler.DefaultFluidHandlerStorage<T extends IFluidHandler> extends java.lang.Object implements Capability.IStorage<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description private
DefaultFluidHandlerStorage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
readNBT(Capability<T> capability, T instance, Direction side, INBT nbt)
Read the capability instance from a NBT tag.INBT
writeNBT(Capability<T> capability, T instance, Direction side)
Serialize the capability instance to a NBTTag.
-
-
-
Method Detail
-
writeNBT
public INBT writeNBT(Capability<T> capability, T instance, Direction side)
Description copied from interface:Capability.IStorage
Serialize the capability instance to a NBTTag. This allows for a central implementation of saving the data. It is important to note that it is up to the API defining the capability what requirements the 'instance' value must have. Due to the possibility of manipulating internal data, some implementations MAY require that the 'instance' be an instance of the 'default' implementation. Review the API docs for more info.- Specified by:
writeNBT
in interfaceCapability.IStorage<T extends IFluidHandler>
- Parameters:
capability
- The Capability being stored.instance
- An instance of that capabilities interface.side
- The side of the object the instance is associated with.- Returns:
- a NBT holding the data. Null if no data needs to be stored.
-
readNBT
public void readNBT(Capability<T> capability, T instance, Direction side, INBT nbt)
Description copied from interface:Capability.IStorage
Read the capability instance from a NBT tag. This allows for a central implementation of saving the data. It is important to note that it is up to the API defining the capability what requirements the 'instance' value must have. Due to the possibility of manipulating internal data, some implementations MAY require that the 'instance' be an instance of the 'default' implementation. Review the API docs for more info. *- Specified by:
readNBT
in interfaceCapability.IStorage<T extends IFluidHandler>
- Parameters:
capability
- The Capability being stored.instance
- An instance of that capabilities interface.side
- The side of the object the instance is associated with.nbt
- A NBT holding the data. Must not be null, as doesn't make sense to call this function with nothing to read...
-
-