Package org.cyclops.cyclopscore.helper
Class FluidHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.FluidHelpers
Deprecated.
Contains helper methods for various fluid specific things.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanCompletelyFill(net.neoforged.neoforge.fluids.capability.IFluidHandler source, net.neoforged.neoforge.fluids.capability.IFluidHandler destination) Deprecated.If this destination can completely contain the given fluid in the given source.static net.neoforged.neoforge.fluids.FluidStackcopy(net.neoforged.neoforge.fluids.FluidStack fluidStack) Deprecated.Copy the given fluid stackstatic net.neoforged.neoforge.fluids.FluidStackextractFromInventory(int amount, net.minecraft.world.item.ItemStack blacklistedStack, net.minecraft.world.level.material.Fluid fluidWhitelist, net.minecraft.world.entity.player.Player player, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction action) Deprecated.Extract the given fluid amount from any item inside the player's inventory.static net.neoforged.neoforge.fluids.FluidStackextractFromItemOrInventory(int amount, net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.player.Player player, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction action) Deprecated.Extract the given fluid amount from the given item, or from the player's inventory if that fails.static intgetAmount(net.neoforged.neoforge.fluids.FluidStack fluidStack) Deprecated.Get the fluid amount of the given stack in a safe manner.static intgetCapacity(net.neoforged.neoforge.fluids.capability.IFluidHandler fluidHandler) Deprecated.Get the capacity of a fluid handler.static net.neoforged.neoforge.fluids.FluidStackgetFluid(net.neoforged.neoforge.fluids.capability.IFluidHandler fluidHandler) Deprecated.Get the fluid contained in a fluid handler.static Optional<IFluidHandlerItemCapacity> getFluidHandlerItemCapacity(net.minecraft.world.item.ItemStack itemStack) Deprecated.static booleanhasFluid(net.neoforged.neoforge.fluids.capability.IFluidHandler fluidHandler) Deprecated.Check if the fluid handler is not empty.static voidplaceOrPickUpFluid(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction side) Deprecated.Try placing or picking up fluids from the held item.static net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidActionsimulateBooleanToAction(boolean simulate) Deprecated.Convert a boolean-based simulate to a fluid action enum value.
-
Field Details
-
BUCKET_VOLUME
public static final int BUCKET_VOLUMEDeprecated.- See Also:
-
-
Constructor Details
-
FluidHelpers
public FluidHelpers()Deprecated.
-
-
Method Details
-
getAmount
public static int getAmount(net.neoforged.neoforge.fluids.FluidStack fluidStack) Deprecated.Get the fluid amount of the given stack in a safe manner.- Parameters:
fluidStack- The fluid stack- Returns:
- The fluid amount.
-
copy
public static net.neoforged.neoforge.fluids.FluidStack copy(net.neoforged.neoforge.fluids.FluidStack fluidStack) Deprecated.Copy the given fluid stack- Parameters:
fluidStack- The fluid stack to copy.- Returns:
- A copy of the fluid stack.
-
canCompletelyFill
public static boolean canCompletelyFill(net.neoforged.neoforge.fluids.capability.IFluidHandler source, net.neoforged.neoforge.fluids.capability.IFluidHandler destination) Deprecated.If this destination can completely contain the given fluid in the given source.- Parameters:
source- The source of the fluid that has to be moved.destination- The target of the fluid that has to be moved.- Returns:
- If the destination can completely contain the fluid of the source.
-
getFluid
public static net.neoforged.neoforge.fluids.FluidStack getFluid(@Nullable net.neoforged.neoforge.fluids.capability.IFluidHandler fluidHandler) Deprecated.Get the fluid contained in a fluid handler.- Parameters:
fluidHandler- The fluid handler.- Returns:
- The fluid.
-
hasFluid
public static boolean hasFluid(@Nullable net.neoforged.neoforge.fluids.capability.IFluidHandler fluidHandler) Deprecated.Check if the fluid handler is not empty.- Parameters:
fluidHandler- The fluid handler.- Returns:
- If it is not empty.
-
getCapacity
public static int getCapacity(@Nullable net.neoforged.neoforge.fluids.capability.IFluidHandler fluidHandler) Deprecated.Get the capacity of a fluid handler.- Parameters:
fluidHandler- The fluid handler.- Returns:
- The capacity.
-
getFluidHandlerItemCapacity
public static Optional<IFluidHandlerItemCapacity> getFluidHandlerItemCapacity(net.minecraft.world.item.ItemStack itemStack) Deprecated.- Parameters:
itemStack- The itemstack- Returns:
- The item capacity fluid handler.
-
extractFromInventory
public static net.neoforged.neoforge.fluids.FluidStack extractFromInventory(int amount, @Nullable net.minecraft.world.item.ItemStack blacklistedStack, @Nullable net.minecraft.world.level.material.Fluid fluidWhitelist, net.minecraft.world.entity.player.Player player, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction action) Deprecated.Extract the given fluid amount from any item inside the player's inventory.- Parameters:
amount- A fluid amount to extract.blacklistedStack- The itemstack to skip. Useful if this is the stack that you are inserting to.fluidWhitelist- A fluid to transfer, can be null to allow any fluid to be transferred.player- The player to scan the inventory from.action- The fluid action.- Returns:
- The extracted fluidstack.
-
extractFromItemOrInventory
public static net.neoforged.neoforge.fluids.FluidStack extractFromItemOrInventory(int amount, net.minecraft.world.item.ItemStack itemStack, @Nullable net.minecraft.world.entity.player.Player player, net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction action) Deprecated.Extract the given fluid amount from the given item, or from the player's inventory if that fails.- Parameters:
amount- A fluid amount to extract.itemStack- The item to extract from first.player- The player to scan the inventory from.action- The fluid action.- Returns:
- The extracted fluidstack.
-
placeOrPickUpFluid
public static void placeOrPickUpFluid(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos blockPos, net.minecraft.core.Direction side) Deprecated.Try placing or picking up fluids from the held item. This can be called inItem.use(net.minecraft.world.level.Level, net.minecraft.world.entity.player.Player, net.minecraft.world.InteractionHand).- Parameters:
player- The active player.hand- The active hand.world- The world.blockPos- The target position.side- The target side.
-
simulateBooleanToAction
public static net.neoforged.neoforge.fluids.capability.IFluidHandler.FluidAction simulateBooleanToAction(boolean simulate) Deprecated.Convert a boolean-based simulate to a fluid action enum value.- Parameters:
simulate- If in simulation mode.- Returns:
- The fluid action.
-