Class BlockWrapper
- java.lang.Object
-
- net.minecraftforge.fluids.capability.templates.VoidFluidHandler
-
- net.minecraftforge.fluids.capability.wrappers.BlockWrapper
-
- All Implemented Interfaces:
IFluidHandler
public class BlockWrapper extends VoidFluidHandler
Wrapper around any block, only accounts for fluid placement, otherwise the block acts a void. If the block in question inherits from the default Vanilla or Forge implementations, consider usingBlockLiquidWrapper
orFluidBlockWrapper
respectively.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockWrapper.LiquidContainerBlockWrapper
-
Nested classes/interfaces inherited from interface net.minecraftforge.fluids.capability.IFluidHandler
IFluidHandler.FluidAction
-
-
Field Summary
Fields Modifier and Type Field Description protected BlockPos
blockPos
protected BlockState
state
protected World
world
-
Fields inherited from class net.minecraftforge.fluids.capability.templates.VoidFluidHandler
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description BlockWrapper(BlockState state, World world, BlockPos blockPos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
fill(FluidStack resource, IFluidHandler.FluidAction action)
Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.-
Methods inherited from class net.minecraftforge.fluids.capability.templates.VoidFluidHandler
drain, drain, getFluidInTank, getTankCapacity, getTanks, isFluidValid
-
-
-
-
Field Detail
-
state
protected final BlockState state
-
world
protected final World world
-
blockPos
protected final BlockPos blockPos
-
-
Constructor Detail
-
BlockWrapper
public BlockWrapper(BlockState state, World world, BlockPos blockPos)
-
-
Method Detail
-
fill
public int fill(FluidStack resource, IFluidHandler.FluidAction action)
Description copied from interface:IFluidHandler
Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.- Specified by:
fill
in interfaceIFluidHandler
- Overrides:
fill
in classVoidFluidHandler
- Parameters:
resource
- FluidStack representing the Fluid and maximum amount of fluid to be filled.action
- If SIMULATE, fill will only be simulated.- Returns:
- Amount of resource that was (or would have been, if simulated) filled.
-
-