Package forestry.api.apiculture
Interface IFlowerType
public interface IFlowerType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<IFlowerType> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, IFlowerType> -
Method Summary
Modifier and TypeMethodDescriptiondefault List<net.minecraft.world.item.ItemStack> affectProducts(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, IIndividual individual, List<net.minecraft.world.item.ItemStack> products) Allows the flower provider to affect the produce at the given location.booleanisAcceptableFlower(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Checks if the flower at the specified position is accepted by this rule.booleanbooleanplantRandomFlower(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, List<net.minecraft.world.level.block.state.BlockState> nearbyFlowers) Tries to plant a random flower at a position near a hive.default FlowerTypeType<?> type()
-
Field Details
-
CODEC
-
STREAM_CODEC
static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,IFlowerType> STREAM_CODEC
-
-
Method Details
-
isDominant
boolean isDominant()- Returns:
- Whether the allele for this value is dominant or recessive.
-
isAcceptableFlower
boolean isAcceptableFlower(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Checks if the flower at the specified position is accepted by this rule. -
plantRandomFlower
boolean plantRandomFlower(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, List<net.minecraft.world.level.block.state.BlockState> nearbyFlowers) Tries to plant a random flower at a position near a hive.- Parameters:
level- The current dimension of the hive.pos- The position to try to plant at.nearbyFlowers- The list of flowers already near the hive.- Returns:
trueif the flower was planted.
-
affectProducts
default List<net.minecraft.world.item.ItemStack> affectProducts(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, IIndividual individual, List<net.minecraft.world.item.ItemStack> products) Allows the flower provider to affect the produce at the given location. If this flowerProvider does not affect the products, it should return the products unchanged. -
type
- Returns:
- The serializer for this flower type, used to encode it for datapacks/network. Only serializable (datapack-backed or synced) flower types override this; purely code-registered types that hold behaviour as lambdas (e.g. KubeJS) are never serialized and keep the throwing default.
-