Class CropBehavior
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
public abstract class CropBehavior
- Inheritance
-
CropBehavior
- Inherited Members
- Extension Methods
Constructors
CropBehavior(Block)
public CropBehavior(Block block)
Parameters
block
Block
Fields
block
public Block block
Field Value
Methods
Initialize(JsonObject)
Initializes the crop with additional properties.
public virtual void Initialize(JsonObject properties)
Parameters
properties
JsonObject
OnPlanted(ICoreAPI)
The event fired when the crop is planted.
public virtual void OnPlanted(ICoreAPI api)
Parameters
api
ICoreAPIThe core API.
TryGrowCrop(ICoreAPI, IFarmlandBlockEntity, double, int, ref EnumHandling)
Attempts to grow the crop.
public virtual bool TryGrowCrop(ICoreAPI api, IFarmlandBlockEntity farmland, double currentTotalHours, int newGrowthStage, ref EnumHandling handling)
Parameters
api
ICoreAPIThe Core API
farmland
IFarmlandBlockEntityThe farmland below the crop.
currentTotalHours
doublenewGrowthStage
intThe next growth stage.
handling
EnumHandlingWhether or not this event was handled.
Returns
- bool
Whether or not the crop grew.