summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-01-27 22:02:19 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2014-01-27 22:02:19 +0100
commitbabc80ed777f2ee74ce770d95bd3ec5743370570 (patch)
tree3ae0e484d679acc57fc76c982c7f52268cef5f3c /src/Mobs
parentVillager: Few more comments. (diff)
downloadcuberite-babc80ed777f2ee74ce770d95bd3ec5743370570.tar
cuberite-babc80ed777f2ee74ce770d95bd3ec5743370570.tar.gz
cuberite-babc80ed777f2ee74ce770d95bd3ec5743370570.tar.bz2
cuberite-babc80ed777f2ee74ce770d95bd3ec5743370570.tar.lz
cuberite-babc80ed777f2ee74ce770d95bd3ec5743370570.tar.xz
cuberite-babc80ed777f2ee74ce770d95bd3ec5743370570.tar.zst
cuberite-babc80ed777f2ee74ce770d95bd3ec5743370570.zip
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/Villager.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp
index 262f13a99..74a2a6d99 100644
--- a/src/Mobs/Villager.cpp
+++ b/src/Mobs/Villager.cpp
@@ -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)
{