public class FluidUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
interactWithTank(ItemStack stack,
EntityPlayer player,
IFluidHandler tank,
EnumFacing side)
Returns true if interaction was successful.
|
static ItemStack |
tryEmptyBucket(ItemStack bucket,
IFluidHandler tank,
EnumFacing side)
Deprecated.
|
static ItemStack |
tryEmptyBucket(ItemStack bucket,
IFluidHandler tank,
EnumFacing side,
EntityPlayer player)
Takes a filled bucket and tries to empty it into the given tank.
|
static boolean |
tryEmptyFluidContainerItem(ItemStack container,
IFluidHandler tank,
EnumFacing side,
EntityPlayer player) |
static boolean |
tryEmptyFluidContainerItem(ItemStack container,
IFluidHandler tank,
EnumFacing side,
IItemHandler inventory,
int max,
EntityPlayer player)
Takes an IFluidContainerItem and tries to empty it into the given tank.
|
static ItemStack |
tryFillBucket(ItemStack bucket,
IFluidHandler tank,
EnumFacing side)
Deprecated.
|
static ItemStack |
tryFillBucket(ItemStack bucket,
IFluidHandler tank,
EnumFacing side,
EntityPlayer player)
Fill an empty bucket from the given tank.
|
static boolean |
tryFillFluidContainerItem(ItemStack container,
IFluidHandler tank,
EnumFacing side,
EntityPlayer player)
Takes an IFluidContainerItem and tries to fill it from the given tank.
|
static boolean |
tryFillFluidContainerItem(ItemStack container,
IFluidHandler tank,
EnumFacing side,
IItemHandler inventory,
int max,
EntityPlayer player)
Takes an IFluidContainerItem and tries to fill it from the given tank.
|
public static boolean interactWithTank(ItemStack stack, EntityPlayer player, IFluidHandler tank, EnumFacing side)
@Deprecated public static ItemStack tryFillBucket(ItemStack bucket, IFluidHandler tank, EnumFacing side)
public static ItemStack tryFillBucket(ItemStack bucket, IFluidHandler tank, EnumFacing side, EntityPlayer player)
bucket
- The empty buckettank
- The tank to fill the bucket fromside
- Side to access the tank from@Deprecated public static ItemStack tryEmptyBucket(ItemStack bucket, IFluidHandler tank, EnumFacing side)
public static ItemStack tryEmptyBucket(ItemStack bucket, IFluidHandler tank, EnumFacing side, EntityPlayer player)
bucket
- The filled buckettank
- The tank to fill with the bucketside
- Side to access the tank fromplayer
- public static boolean tryFillFluidContainerItem(ItemStack container, IFluidHandler tank, EnumFacing side, EntityPlayer player)
container
- The IFluidContainerItem Itemstack to fill. WILL BE MODIFIED!tank
- The tank to fill fromside
- Side to access the tank fromplayer
- The player that tries to fill the bucket. Needed if the input itemstack has a stacksize > 1 to determine where the filled container goes.public static boolean tryEmptyFluidContainerItem(ItemStack container, IFluidHandler tank, EnumFacing side, EntityPlayer player)
public static boolean tryFillFluidContainerItem(ItemStack container, IFluidHandler tank, EnumFacing side, IItemHandler inventory, int max, EntityPlayer player)
container
- The IFluidContainerItem Itemstack to fill. WILL BE MODIFIED!tank
- The tank to fill fromside
- Side to access the tank frominventory
- An inventory where any additionally created item (filled container if multiple empty are present) are putmax
- Maximum amount to take from the tank. Uses IFluidContainerItem capacity if <= 0player
- The player that gets the items the inventory can't take. Can be null, only used if the inventory cannot take the filled stack.public static boolean tryEmptyFluidContainerItem(ItemStack container, IFluidHandler tank, EnumFacing side, IItemHandler inventory, int max, EntityPlayer player)
container
- The IFluidContainerItem Itemstack to empty. WILL BE MODIFIED!tank
- The tank to fillside
- Side to access the tank frominventory
- An inventory where any additionally created item (filled container if multiple empty are present) are putmax
- Maximum amount to take from the tank. Uses IFluidContainerItem capacity if <= 0player
- The player that gets the items the inventory can't take. Can be null, only used if the inventory cannot take the emptied stack.