Class GenericItemFilling

java.lang.Object
com.simibubi.create.content.contraptions.fluids.actors.GenericItemFilling

public class GenericItemFilling extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    canItemBeFilled(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack)
     
    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)
     
    static int
    getRequiredAmountForItem(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.FluidStack availableFluid)
     
    static boolean
    isFluidHandlerValid(net.minecraft.world.item.ItemStack stack, net.minecraftforge.fluids.capability.IFluidHandlerItem fluidHandler)
    Checks if an ItemStack's IFluidHandlerItem is valid.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)