mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-03-22 07:48:13 +05:00
Fix tamed horses despawning when player moves away (#1057)
Co-authored-by: MCbabel <MCbabel@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user