1
0

The world can now be configured wether farmers should be able to harvest crops.

This commit is contained in:
STRWarrior
2014-01-27 22:02:19 +01:00
parent 8bf9043f98
commit babc80ed77
3 changed files with 14 additions and 0 deletions

View File

@@ -141,6 +141,11 @@ void cVillager::HandleFarmerAttemptSpecialAction()
void cVillager::HandleFarmerAction()
{
if (!m_World->VillagersShouldHarvestCrops())
{
return;
}
// Harvest the crops if the villager isn't moving and if the crops are closer then 2 blocks.
if (!m_bMovingToDestination && (GetPosition() - m_CropsPos).Length() < 2)
{
@@ -161,6 +166,11 @@ void cVillager::HandleFarmerAction()
void cVillager::HandleFarmerEndCountDown()
{
if (!m_World->VillagersShouldHarvestCrops())
{
return;
}
// Check if there is still farmland at the spot where the crops were.
if (m_World->GetBlock(m_CropsPos.x, m_CropsPos.y - 1, m_CropsPos.z) == E_BLOCK_FARMLAND)
{