public class FluidUtils
extends java.lang.Object
| Constructor and Description |
|---|
FluidUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isFlowingFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Check if the given blockpos contains a flowing fluid block of any fluid.
|
static boolean |
isFlowingFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.fluid.Fluid fluid)
Check if the given blockpos contains a flowing fluid block of the given fluid type.
|
static boolean |
isSourceFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Check if the given blockpos contains a fluid source block.
|
static boolean |
isSourceFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.fluid.Fluid fluid)
Check if the given blockpos contains a fluid source block of a certain fluid (or possibly any fluid)
|
static boolean |
matchFluid(FluidIngredient fluidIngredient,
net.minecraft.fluid.Fluid fluid,
boolean matchTags) |
static boolean |
matchFluid(FluidIngredient fluidIngredient,
net.minecraftforge.fluids.FluidStack fluidStack,
boolean matchTags) |
static boolean |
tryFluidExtraction(net.minecraftforge.fluids.capability.IFluidHandler srcHandler,
net.minecraft.item.ItemStack destStack,
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> returnedItems)
Attempt to extract fluid from the given fluid handler into the given fluid-containing item.
|
static boolean |
tryFluidExtraction(net.minecraft.tileentity.TileEntity te,
net.minecraft.util.Direction face,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Hand hand)
Have the player attempt to extract liquid from a tile entity, which must support FLUID_HANDLER_CAPABILITY.
|
static boolean |
tryFluidInsertion(net.minecraftforge.fluids.capability.IFluidHandler handler,
net.minecraft.item.ItemStack srcStack,
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> returnedItems)
Attempt to insert fluid into the given fluid handler from the given fluid container item.
|
static boolean |
tryFluidInsertion(net.minecraft.tileentity.TileEntity te,
net.minecraft.util.Direction face,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Hand hand)
Have the player attempt to insert liquid into a tile entity, which must support FLUID_HANDLER_CAPABILITY.
|
static net.minecraftforge.fluids.FluidStack |
tryPickupFluid(net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler> fluidCap,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean playSound,
net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
Attempt to pick up 1000mB (one bucket) fluid from the world and stow it in the given fluid handler.
|
static boolean |
tryPourOutFluid(net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler> fluidCap,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean playSound,
boolean force,
net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
Try to pour 1000mB (one bucket) of fluid into the world at the given position.
|
public static boolean tryFluidExtraction(net.minecraftforge.fluids.capability.IFluidHandler srcHandler,
net.minecraft.item.ItemStack destStack,
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> returnedItems)
srcHandler - fluid handler into which to place the fluiddestStack - the fluid container item to extract fromreturnedItems - the modified fluid container after extractionpublic static boolean tryFluidInsertion(net.minecraftforge.fluids.capability.IFluidHandler handler,
net.minecraft.item.ItemStack srcStack,
net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> returnedItems)
handler - the handler to extract fromsrcStack - the fluid container item to insert toreturnedItems - the modified fluid container after insertionpublic static boolean tryFluidInsertion(net.minecraft.tileentity.TileEntity te,
net.minecraft.util.Direction face,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Hand hand)
te - the tile entity to insert intoface - the face of the tile entity's block to insert toplayer - the playerhand - the hand being usedpublic static boolean tryFluidExtraction(net.minecraft.tileentity.TileEntity te,
net.minecraft.util.Direction face,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Hand hand)
te - the tile entity to extract fromface - the face of the tile entity's block to extract fromplayer - the playerhand - the hand being usedpublic static boolean isSourceFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
world - the worldpos - the blockpospublic static boolean isSourceFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
@Nullable
net.minecraft.fluid.Fluid fluid)
world - the worldpos - the blockposfluid - the fluid, may be null to match any fluidpublic static boolean isFlowingFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
world - the worldpos - the blockpospublic static boolean isFlowingFluidBlock(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
@Nullable
net.minecraft.fluid.Fluid fluid)
world - the worldpos - the blockposfluid - the fluid (null to match any fluid)public static net.minecraftforge.fluids.FluidStack tryPickupFluid(net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler> fluidCap,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean playSound,
net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
fluidCap - the fluid capability to insert fluid toworld - the worldpos - the block pos to pull fluid fromplaySound - true to play a bucket-fill soundaction - whether to simulate the actionpublic static boolean tryPourOutFluid(net.minecraftforge.common.util.LazyOptional<net.minecraftforge.fluids.capability.IFluidHandler> fluidCap,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
boolean playSound,
boolean force,
net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
fluidCap - the fluid capabilityworld - the worldpos - block to pour fluid atplaySound - true to play a bucket-empty soundforce - if true, fluid will be poured out even if the block space is not completely emptypublic static boolean matchFluid(FluidIngredient fluidIngredient, net.minecraftforge.fluids.FluidStack fluidStack, boolean matchTags)
public static boolean matchFluid(FluidIngredient fluidIngredient, net.minecraft.fluid.Fluid fluid, boolean matchTags)