Package forestry.api.genetics.pollen
Interface IPollen<P>
public interface IPollen<P>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Tnet.minecraft.world.item.ItemStackUsed by the Alveary Sieve and butterflies to collect item forms of pollen.getType()default booleantryPollinate(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, Object pollinator) net.minecraft.nbt.TagwriteNbt()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.EMPTYif 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)
-