Package alexiil.mc.lib.attributes.fluid
Class FluidVolumeUtil.FluidTankInteraction
java.lang.Object
alexiil.mc.lib.attributes.fluid.FluidVolumeUtil.FluidTankInteraction
- Enclosing class:
- FluidVolumeUtil
public static final class FluidVolumeUtil.FluidTankInteraction
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description FluidVolume
fluidMoved
A copy of the fluid moved.FluidVolumeUtil.ItemContainerStatus
fromTankStatus
boolean
intoTank
If true then the interaction drained fluid from theItemStack
, and inserted it into theFluidInsertable
tank.FluidVolumeUtil.ItemContainerStatus
intoTankStatus
static FluidVolumeUtil.FluidTankInteraction
NONE
-
Constructor Summary
Constructors Constructor Description FluidTankInteraction(FluidVolume fluidMoved, boolean intoTank)
Deprecated.FluidTankInteraction(FluidVolume fluidMoved, boolean intoTank, FluidVolumeUtil.ItemContainerStatus intoTankStatus, FluidVolumeUtil.ItemContainerStatus fromTankStatus)
Constructs a newFluidVolumeUtil.FluidTankInteraction
object. -
Method Summary
Modifier and Type Method Description int
amountMoved()
Deprecated.FluidAmount
amountMoved_F()
net.minecraft.util.ActionResult
asActionResult()
Converts this interaction result into a vanilla minecraftActionResult
, suitable for normal block or item "use" methods.boolean
didCheckItemStack()
boolean
didMoveAny()
Checks to see if any fluid was moved in the interaction.static FluidVolumeUtil.FluidTankInteraction
fromTank(FluidVolume fluid)
Deprecated.static FluidVolumeUtil.FluidTankInteraction
intoTank(FluidVolume fluid)
Deprecated.static FluidVolumeUtil.FluidTankInteraction
none(FluidVolumeUtil.ItemContainerStatus intoTankStatus, FluidVolumeUtil.ItemContainerStatus fromTankStatus)
boolean
wasContainerValid()
-
Field Details
-
NONE
-
fluidMoved
A copy of the fluid moved. -
intoTank
public final boolean intoTankIf true then the interaction drained fluid from theItemStack
, and inserted it into theFluidInsertable
tank. Otherwise this will be false. -
intoTankStatus
-
fromTankStatus
-
-
Constructor Details
-
FluidTankInteraction
Deprecated. -
FluidTankInteraction
public FluidTankInteraction(FluidVolume fluidMoved, boolean intoTank, FluidVolumeUtil.ItemContainerStatus intoTankStatus, FluidVolumeUtil.ItemContainerStatus fromTankStatus)Constructs a newFluidVolumeUtil.FluidTankInteraction
object.Generally it is not expected that this be called by any method other than
FluidInvUtil.interactItemWithTank(FluidInsertable, FluidExtractable, Reference, LimitedConsumer, FluidAmount)
-
-
Method Details
-
intoTank
Deprecated. -
fromTank
Deprecated. -
none
public static FluidVolumeUtil.FluidTankInteraction none(FluidVolumeUtil.ItemContainerStatus intoTankStatus, FluidVolumeUtil.ItemContainerStatus fromTankStatus) -
didMoveAny
public boolean didMoveAny()Checks to see if any fluid was moved in the interaction.- Returns:
- The inverse of
fluidMoved
.isEmpty()
-
wasContainerValid
public boolean wasContainerValid()- Returns:
- true if either of
intoTankStatus
orfromTankStatus
is#VALID
.
-
didCheckItemStack
public boolean didCheckItemStack()- Returns:
- true if either of
intoTankStatus
orfromTankStatus
is different toFluidVolumeUtil.ItemContainerStatus.NOT_CHECKED
.
-
asActionResult
public net.minecraft.util.ActionResult asActionResult()Converts this interaction result into a vanilla minecraftActionResult
, suitable for normal block or item "use" methods.- Returns:
ActionResult.SUCCESS
ifdidMoveAny()
returns true.ActionResult.FAIL
ifwasContainerValid()
returns true.ActionResult.PASS
otherwise.
ActionResult.FAIL
, but using an unrelated item - such as an iron ingot - should returnActionResult.PASS
)
-
amountMoved
@Deprecated public int amountMoved()Deprecated. -
amountMoved_F
-