Class FluidWorldUtil
java.lang.Object
alexiil.mc.lib.attributes.fluid.world.FluidWorldUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic FluidExtractable
createFluidDrainer(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos)
static FluidInsertable
createFluidPlacer(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos)
static FluidVolume
drain(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos, Simulation simulation)
Attempts to drain the given block of it's fluid.static FluidVolume
fill(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos, FluidVolume volume, Simulation simulation)
Attempts to place the given fluid volume into the given block position.static void
registerCustomDrainable(net.minecraft.block.Block block, IFluidVolumeDrainable drainer)
-
Constructor Details
-
FluidWorldUtil
public FluidWorldUtil()
-
-
Method Details
-
registerCustomDrainable
public static void registerCustomDrainable(net.minecraft.block.Block block, IFluidVolumeDrainable drainer) -
drain
public static FluidVolume drain(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos, Simulation simulation)Attempts to drain the given block of it's fluid. -
fill
public static FluidVolume fill(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos, FluidVolume volume, Simulation simulation)Attempts to place the given fluid volume into the given block position.- Returns:
- The leftover amount of fluid after placing, or the original volume if it was unable to be placed.
-
createFluidDrainer
public static FluidExtractable createFluidDrainer(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos)- Returns:
- A
FluidExtractable
that pumps fluid directly out of the given world co-ordinates. (I.E. from water or lava directly).
-
createFluidPlacer
public static FluidInsertable createFluidPlacer(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos)- Returns:
- A
FluidInsertable
that places the fluid given directly at the given world co-ordinates, if there isn't already fluid there.
-