mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Introduce some (not great) API for entity animations
while this API is a bit yucky, it's a step forward for protocol isolation and offers the possibility of controlling animations by adding events.
This commit is contained in:
@@ -23,12 +23,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\entity;
|
||||
|
||||
use pocketmine\entity\animation\SquidInkCloudAnimation;
|
||||
use pocketmine\event\entity\EntityDamageByEntityEvent;
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\item\VanillaItems;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\network\mcpe\protocol\ActorEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
|
||||
use function atan2;
|
||||
use function mt_rand;
|
||||
@@ -71,7 +71,7 @@ class Squid extends WaterAnimal{
|
||||
$this->swimDirection = $this->location->subtract($e->location)->normalize();
|
||||
}
|
||||
|
||||
$this->broadcastEntityEvent(ActorEventPacket::SQUID_INK_CLOUD);
|
||||
$this->broadcastAnimation(new SquidInkCloudAnimation($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user