Interface IPollenManager


public interface IPollenManager
Keeps track of different pollen types, used by bees and butterflies.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canPollinate(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, Object pollinator)
    Used to determine whether a block can be pollinated or have its pollen collected.
     
    getPollen(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, Object pollinator)
    Gets the pollen from the block at the current position.
    getPollenOfType(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, Object pollinator, Set<net.minecraft.resources.ResourceLocation> pollenTypes)
    Gets the pollen from the block at the current position, but only pollen of certain types.
    default IPollen<?>
    getPollenOfType(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, Object pollinator, net.minecraft.resources.ResourceLocation pollenType)
     
    getPollenType(net.minecraft.resources.ResourceLocation id)
     
  • Method Details

    • canPollinate

      boolean canPollinate(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, @Nullable Object pollinator)
      Used to determine whether a block can be pollinated or have its pollen collected.
      Parameters:
      level - The world to find pollen from.
      pos - The position to check for pollen.
      pollinator - The individual or player (or something else) transporting the pollen.
      Returns:
      true if the target can be pollinated or have its pollen collected.
    • getPollen

      @Nullable IPollen<?> getPollen(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, @Nullable Object pollinator)
      Parameters:
      level - The world to find pollen from.
      pos - The position to check for pollen.
      pollinator - The individual or player (or something else) responsible for gathering the pollen.
      Returns:
      Pollen of an arbitrary type, or null if no pollen of any type was found.
    • getPollenOfType

      @Nullable IPollen<?> getPollenOfType(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, @Nullable Object pollinator, Set<net.minecraft.resources.ResourceLocation> pollenTypes)
      Gets the pollen from the block at the current position, but only pollen of certain types.
      Parameters:
      level - The world to find pollen from.
      pos - The position to check for pollen.
      pollinator - The individual or player (or something else) responsible for gathering the pollen.
      pollenTypes - The types of pollen to check for. Pollen of other types are ignored.
      Returns:
      The pollen at the position, or null if no pollen of the given types was found.
    • getPollenOfType

      @Nullable default IPollen<?> getPollenOfType(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, @Nullable Object pollinator, net.minecraft.resources.ResourceLocation pollenType)
    • getPollenType

      @Nullable IPollenType<?> getPollenType(net.minecraft.resources.ResourceLocation id)
      Returns:
      The pollen type registered with the given ID, or null if none was found.
    • getAllPollenTypes

      Collection<IPollenType<?>> getAllPollenTypes()
      Returns:
      A collection of all registered pollen types.