Class TileFluidHandler
- java.lang.Object
-
- net.minecraftforge.common.capabilities.CapabilityProvider<TileEntity>
-
- net.minecraft.tileentity.TileEntity
-
- net.minecraftforge.fluids.capability.TileFluidHandler
-
- All Implemented Interfaces:
ICapabilityProvider,ICapabilitySerializable<CompoundNBT>,IForgeTileEntity,INBTSerializable<CompoundNBT>
public class TileFluidHandler extends TileEntity
-
-
Field Summary
Fields Modifier and Type Field Description private LazyOptional<IFluidHandler>holderprotected FluidTanktank-
Fields inherited from class net.minecraft.tileentity.TileEntity
level, remove, worldPosition
-
Fields inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
INFINITE_EXTENT_AABB
-
-
Constructor Summary
Constructors Constructor Description TileFluidHandler(TileEntityType<?> tileEntityTypeIn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> LazyOptional<T>getCapability(Capability<T> capability, Direction facing)Retrieves the Optional handler for the capability requested on the specific side.voidload(BlockState state, CompoundNBT tag)CompoundNBTsave(CompoundNBT tag)-
Methods inherited from class net.minecraft.tileentity.TileEntity
clearCache, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getTileData, getType, getUpdatePacket, getUpdateTag, getViewDistance, hasLevel, isRemoved, loadStatic, logInvalidState, mirror, onChunkUnloaded, onlyOpCanSetNbt, rotate, setChanged, setLevelAndPosition, setPosition, setRemoved, triggerEvent
-
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, invalidateCaps, reviveCaps, serializeCaps
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
-
Methods inherited from interface net.minecraftforge.common.extensions.IForgeTileEntity
deserializeNBT, deserializeNBT, getModelData, getRenderBoundingBox, getTileEntity, handleUpdateTag, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
-
-
-
-
Field Detail
-
tank
protected FluidTank tank
-
holder
private final LazyOptional<IFluidHandler> holder
-
-
Constructor Detail
-
TileFluidHandler
public TileFluidHandler(@Nonnull TileEntityType<?> tileEntityTypeIn)
-
-
Method Detail
-
load
public void load(BlockState state, CompoundNBT tag)
- Overrides:
loadin classTileEntity
-
save
public CompoundNBT save(CompoundNBT tag)
- Overrides:
savein classTileEntity
-
getCapability
@Nonnull public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> capability, @Nullable Direction facing)
Description copied from interface:ICapabilityProviderRetrieves 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.- Specified by:
getCapabilityin interfaceICapabilityProvider- Overrides:
getCapabilityin classCapabilityProvider<TileEntity>- Returns:
- The requested an optional holding the requested capability.
-
-