Interface IPollen<P>


public interface IPollen<P>
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> T
     
    net.minecraft.world.item.ItemStack
    Used by the Alveary Sieve and butterflies to collect item forms of pollen.
     
     
    default boolean
    tryPollinate(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, Object pollinator)
     
    net.minecraft.nbt.Tag
    NOTE: Do not write the pollen type ID as part of the returned NBT object, it is handled by Forestry.
  • Method Details

    • getType

      IPollenType<P> getType()
    • getPollen

      P getPollen()
    • writeNbt

      @Nullable net.minecraft.nbt.Tag writeNbt()
      NOTE: Do not write the pollen type ID as part of the returned NBT object, it is handled by Forestry.
      Returns:
      The serialized NBT of this pollen. Should match whatever is deserialized by IPollenType.readNbt(net.minecraft.nbt.Tag).
    • createStack

      net.minecraft.world.item.ItemStack createStack()
      Used by the Alveary Sieve and butterflies to collect item forms of pollen.
      Returns:
      An item form of this pollen, or ItemStack.EMPTY if this pollen has no item form.
    • castPollen

      default <T> T castPollen()
      Returns:
      The value contained in this pollen, cast to the appropriate type. Workaround for generics issues.
    • tryPollinate

      default boolean tryPollinate(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, @Nullable Object pollinator)