mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 04:00:29 +00:00
remove hardcoded legacy entity type ID mapping, load from resources instead
This commit is contained in:
@@ -28,6 +28,7 @@ namespace pocketmine\entity;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\Water;
|
||||
use pocketmine\data\bedrock\LegacyEntityIdToStringIdMap;
|
||||
use pocketmine\entity\animation\Animation;
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\event\entity\EntityDespawnEvent;
|
||||
@@ -1511,7 +1512,7 @@ abstract class Entity{
|
||||
protected function sendSpawnPacket(Player $player) : void{
|
||||
$pk = new AddActorPacket();
|
||||
$pk->entityRuntimeId = $this->getId();
|
||||
$pk->type = AddActorPacket::LEGACY_ID_MAP_BC[static::NETWORK_ID];
|
||||
$pk->type = LegacyEntityIdToStringIdMap::getInstance()->legacyToString(static::NETWORK_ID);
|
||||
$pk->position = $this->location->asVector3();
|
||||
$pk->motion = $this->getMotion();
|
||||
$pk->yaw = $this->location->yaw;
|
||||
|
Reference in New Issue
Block a user