blob: 9b50f0e70686e4e2bbc44eaea63f1a5ff7e870f0 (
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(static_cast<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;
}
|