mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-23 22:43:36 +00:00
18 lines
593 B
C++
18 lines
593 B
C++
#include "../../Platform/stdafx.h"
|
|
#include "../../Headers/net.minecraft.world.entity.player.h"
|
|
#include "../../Headers/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 = std::weak_ptr<Entity>(
|
|
std::dynamic_pointer_cast<Entity>(villager->getTradingPlayer()));
|
|
return true;
|
|
}
|
|
return false;
|
|
} |