Properly switch to string entity IDs

This commit is contained in:
Dylan K. Taylor
2020-06-20 13:43:31 +01:00
parent a988578ee0
commit d38c17835d
20 changed files with 179 additions and 43 deletions

View File

@ -24,11 +24,9 @@ declare(strict_types=1);
namespace pocketmine\world\sound;
use pocketmine\block\Block;
use pocketmine\data\bedrock\LegacyEntityIdToStringIdMap;
use pocketmine\entity\Entity;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\player\Player;
/**
* Played when an entity hits the ground after falling a distance that doesn't cause damage, e.g. due to jumping.
@ -50,7 +48,7 @@ class EntityLandSound implements Sound{
LevelSoundEventPacket::SOUND_LAND,
$pos,
$this->blockLandedOn->getRuntimeId(),
$this->entity instanceof Player ? "minecraft:player" : LegacyEntityIdToStringIdMap::getInstance()->legacyToString($this->entity::getNetworkTypeId()) //TODO: bad hack, stuff depends on players having a -1 network ID :(
$this->entity::getNetworkTypeId()
//TODO: does isBaby have any relevance here?
);
}