Interface GrowthType
- All Known Subinterfaces:
BonemealableGrowthType, ReplantableGrowthType
public interface GrowthType
Holds a
Plant's growth logic.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleancanGrow(GrowthContext context) booleancanHarvest(GrowthContext context) com.mojang.serialization.MapCodec<? extends GrowthType> codec()voidgrow(GrowthContext context) Grows the plant, if possible.List<net.minecraft.world.item.ItemStack> harvest(GrowthContext context, boolean replant) Harvests the plant, if possible.
-
Field Details
-
CODEC
-
-
Method Details
-
codec
com.mojang.serialization.MapCodec<? extends GrowthType> codec()- Returns:
- The registered
MapCodec.
-
canGrow
- Parameters:
context- TheGrowthContextto use.- Returns:
- Whether the plant can currently be grown or not.
-
grow
Grows the plant, if possible.- Parameters:
context- TheGrowthContextto use.
-
canHarvest
- Parameters:
context- TheGrowthContextto use.- Returns:
- Whether the plant can currently be harvested or not.
-
harvest
Harvests the plant, if possible.- Parameters:
context- TheGrowthContextto use.replant- Whether the plant should be replanted or not, if possible.- Returns:
- A list of
ItemStack, representing the drops of the plant.
-