Package forestry.api.genetics.pollen
Interface IPollenManager
public interface IPollenManager
Keeps track of different pollen types, used by bees and butterflies.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanPollinate(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.IPollen<?>getPollen(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, Object pollinator) Gets the pollen from the block at the current position.IPollen<?>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) IPollenType<?>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:
trueif 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) Gets the pollen from the block at the current position. UsegetPollenOfType(net.minecraft.world.level.LevelAccessor, net.minecraft.core.BlockPos, java.lang.Object, java.util.Set<net.minecraft.resources.ResourceLocation>)to find a specific type(s) of pollen.- 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
nullif 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
nullif no pollen of the given types was found.
-
getPollenOfType
-
getPollenType
- Returns:
- The pollen type registered with the given ID, or
nullif none was found.
-
getAllPollenTypes
Collection<IPollenType<?>> getAllPollenTypes()- Returns:
- A collection of all registered pollen types.
-