Interface IProduct

All Known Implementing Classes:
Product

public interface IProduct
Represents some item that has a set chance of being produced.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final it.unimi.dsi.fastutil.Hash.Strategy<IProduct>
    A hashing strategy used for FastUtil custom hash collections.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
     
    default net.minecraft.world.item.ItemStack
    createRandomStack(net.minecraft.util.RandomSource random)
    Used to produce a random variant of this product.
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.item.Item
    Gets the item this product contains.
  • Field Details

    • ITEM_ONLY_STRATEGY

      static final it.unimi.dsi.fastutil.Hash.Strategy<IProduct> ITEM_ONLY_STRATEGY
      A hashing strategy used for FastUtil custom hash collections. Currently, Forestry uses this to remove common products between species from the product list of a hybrid bee.
  • Method Details

    • item

      net.minecraft.world.item.Item item()
      Gets the item this product contains. In the case of a dynamic product, return an item that might be used to display it in a screen or for equality purposes in ITEM_ONLY_STRATEGY.
      Returns:
      The item this product represents.
    • chance

      float chance()
      Returns:
      The set chance of this product being produced.
    • createStack

      net.minecraft.world.item.ItemStack createStack()
      Returns:
      A new stack of this product. If your product is dynamic, return a "default" nonempty stack.
    • createRandomStack

      default net.minecraft.world.item.ItemStack createRandomStack(net.minecraft.util.RandomSource random)
      Used to produce a random variant of this product.
      Parameters:
      random - The random source. If no randomness is desired, call createStack() instead.
      Returns:
      A new stack of this product with potentially random properties.