QtCraft API C++ classes QML types Handbook

QcCropDefinition Struct

A plant that ripens in stages (wheat, carrots, pumpkin stems), driven by random ticks on the server (decision E-289). More...

Header: #include <common/content/recipes/QcFarmingDefinitions.h>

Public Functions

bool bearsFruit() const
bool isCrop() const

Public Variables

double averageSeconds
double dryFactor
QString fruit
QStringList fruitGround
double fruitSeconds
int minLight
double plantChance
QString property

Detailed Description

Its stages are the values of the state property property in their order; the last value is ripe. A ripe plant with a fruit (stems) then puts that block onto a free neighbouring cell whose ground is one of fruitGround. Server side only.

Member Function Documentation

bool QcCropDefinition::bearsFruit() const

Returns whether a ripe plant grows a fruit (fruit is set).

bool QcCropDefinition::isCrop() const

Returns whether the block is a crop (property is set).

Member Variable Documentation

double QcCropDefinition::averageSeconds

Average seconds from the first to the ripe stage on wet soil in enough light.

double QcCropDefinition::dryFactor

Factor on the pace on soil that is not wet (and on any other ground).

QString QcCropDefinition::fruit

Block a ripe plant grows next to it ("fruit"); empty for none.

QStringList QcCropDefinition::fruitGround

Blocks the cell below a fruit may be ("fruitGround"); required with a fruit.

double QcCropDefinition::fruitSeconds

Average seconds for one fruit ("fruitSeconds", 1 to 86400).

int QcCropDefinition::minLight

Light (the brighter of sky and block light) a stage step needs, 0..15.

double QcCropDefinition::plantChance

Chance per check (once a second) that a dropped item placing this crop, lying on free soil, plants itself (decision E-294); 0 never.

QString QcCropDefinition::property

State property holding the stage; empty for blocks that are no crop.