aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/LookAtTradingPlayerGoal.cpp
blob: db1e25a2eb9636b0e1b28a4c3c74eafc79683ab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "stdafx.h"
#include "net.minecraft.world.entity.player.h"
#include "net.minecraft.world.entity.npc.h"
#include "LookAtTradingPlayerGoal.h"

LookAtTradingPlayerGoal::LookAtTradingPlayerGoal(Villager *villager) : LookAtPlayerGoal((Mob *)villager, typeid(Player), 8)
{
	this->villager = villager;
}

bool LookAtTradingPlayerGoal::canUse()
{
	if (villager->isTrading())
	{
		lookAt = weak_ptr<Entity>(dynamic_pointer_cast<Entity>(villager->getTradingPlayer()));
		return true;
	}
	return false;
}