mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-23 07:27:20 +00:00
Fix tamed horses despawning when player moves away (#1057)
Co-authored-by: MCbabel <MCbabel@users.noreply.github.com>
This commit is contained in:
parent
c90a6bf5ab
commit
91ae76f132
|
|
@ -515,6 +515,15 @@ bool EntityHorse::canSpawn()
|
|||
return Animal::canSpawn();
|
||||
}
|
||||
|
||||
bool EntityHorse::removeWhenFarAway()
|
||||
{
|
||||
if (isTamed()) return false;
|
||||
if (isSaddled()) return false;
|
||||
if (isLeashed()) return false;
|
||||
if (getArmorType() > 0) return false;
|
||||
return Animal::removeWhenFarAway();
|
||||
}
|
||||
|
||||
|
||||
shared_ptr<EntityHorse> EntityHorse::getClosestMommy(shared_ptr<Entity> baby, double searchRadius)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ private:
|
|||
public:
|
||||
virtual void containerChanged();
|
||||
virtual bool canSpawn();
|
||||
virtual bool removeWhenFarAway() override;
|
||||
|
||||
protected:
|
||||
virtual shared_ptr<EntityHorse> getClosestMommy(shared_ptr<Entity> baby, double searchRadius);
|
||||
|
|
|
|||
Loading…
Reference in a new issue