Class GenericItemFilling
java.lang.Object
com.simibubi.create.content.contraptions.fluids.actors.GenericItemFilling
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanItemBeFilled(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack) static net.minecraft.world.item.ItemStackfillItem(net.minecraft.world.level.Level world, int requiredAmount, net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.FluidStack availableFluid) static intgetRequiredAmountForItem(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.FluidStack availableFluid) static booleanisFluidHandlerValid(net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.capability.IFluidHandlerItem fluidHandler) Checks if an ItemStack's IFluidHandlerItem is valid.
-
Constructor Details
-
GenericItemFilling
public GenericItemFilling()
-
-
Method Details
-
isFluidHandlerValid
public static boolean isFluidHandlerValid(net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.capability.IFluidHandlerItem fluidHandler) Checks if an ItemStack's IFluidHandlerItem is valid. Ideally, this check would not be necessary. Unfortunately, some mods that copy the functionality of the MilkBucketItem copy the FluidBucketWrapper capability that is patched in by Forge without looking into what it actually does. In all cases this is incorrect because having a non-bucket item turn into a bucket item does not make sense.This check is only necessary for filling since a FluidBucketWrapper will be empty if it is initialized with a non-bucket item.
- Parameters:
stack- The ItemStack.fluidHandler- The IFluidHandlerItem instance retrieved from the ItemStack.- Returns:
- If the IFluidHandlerItem is valid for the passed ItemStack.
-
canItemBeFilled
public static boolean canItemBeFilled(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack) -
getRequiredAmountForItem
public static int getRequiredAmountForItem(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.FluidStack availableFluid) -
fillItem
public static net.minecraft.world.item.ItemStack fillItem(net.minecraft.world.level.Level world, int requiredAmount, net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.FluidStack availableFluid)
-