Class BlockWrapper

java.lang.Object
net.neoforged.neoforge.fluids.capability.templates.VoidFluidHandler
net.neoforged.neoforge.fluids.capability.wrappers.BlockWrapper
All Implemented Interfaces:
IFluidHandler

@Deprecated(since="1.21.9", forRemoval=true) public class BlockWrapper extends VoidFluidHandler
Deprecated, for removal: This API element is subject to removal in a future version.
Wrapper around any block, only accounts for fluid placement, otherwise the block acts a void.
  • Field Details

    • state

      protected final BlockState state
      Deprecated, for removal: This API element is subject to removal in a future version.
    • world

      protected final Level world
      Deprecated, for removal: This API element is subject to removal in a future version.
    • blockPos

      protected final BlockPos blockPos
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • BlockWrapper

      public BlockWrapper(BlockState state, Level world, BlockPos blockPos)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • fill

      public int fill(FluidStack resource, IFluidHandler.FluidAction action)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IFluidHandler
      Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.
      Specified by:
      fill in interface IFluidHandler
      Overrides:
      fill in class VoidFluidHandler
      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.