Class FluidWorldUtil
java.lang.Object
alexiil.mc.lib.attributes.fluid.world.FluidWorldUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FluidExtractablecreateFluidDrainer(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos) static FluidInsertablecreateFluidPlacer(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos) static FluidVolumedrain(net.minecraft.world.WorldAccess world, net.minecraft.util.math.BlockPos pos, Simulation simulation) Attempts to drain the given block of it's fluid.static FluidVolumefill(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 voidregisterCustomDrainable(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
FluidExtractablethat 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
FluidInsertablethat places the fluid given directly at the given world co-ordinates, if there isn't already fluid there.
-