Class BucketItem

    • Field Detail

      • content

        private final Fluid content
      • fluidSupplier

        private final java.util.function.Supplier<? extends Fluid> fluidSupplier
    • Constructor Detail

      • BucketItem

        @Deprecated
        public BucketItem​(Fluid p_i49025_1_,
                          Item.Properties p_i49025_2_)
        Deprecated.
      • BucketItem

        public BucketItem​(java.util.function.Supplier<? extends Fluid> supplier,
                          Item.Properties builder)
        Parameters:
        supplier - A fluid supplier such as RegistryObject
    • Method Detail

      • checkExtraContent

        public void checkExtraContent​(World p_203792_1_,
                                      ItemStack p_203792_2_,
                                      BlockPos p_203792_3_)
      • playEmptySound

        protected void playEmptySound​(@Nullable
                                      PlayerEntity p_203791_1_,
                                      IWorld p_203791_2_,
                                      BlockPos p_203791_3_)
      • initCapabilities

        public ICapabilityProvider initCapabilities​(ItemStack stack,
                                                    @Nullable
                                                    CompoundNBT nbt)
        Description copied from interface: IForgeItem
        Called from ItemStack.setItem, will hold extra data for the life of this ItemStack. Can be retrieved from stack.getCapabilities() The NBT can be null if this is not called from readNBT or if the item the stack is changing FROM is different then this item, or the previous item had no capabilities. This is called BEFORE the stacks item is set so you can use stack.getItem() to see the OLD item. Remember that getItem CAN return null.
        Parameters:
        stack - The ItemStack
        nbt - NBT of this item serialized, or null.
        Returns:
        A holder instance associated with this ItemStack where you can hold capabilities for the life of this item.
      • getFluid

        public Fluid getFluid()
      • canBlockContainFluid

        private boolean canBlockContainFluid​(World worldIn,
                                             BlockPos posIn,
                                             BlockState blockstate)