Merge branch 'next-minor' into next-major

This commit is contained in:
Dylan K. Taylor
2022-06-29 16:53:50 +01:00
3 changed files with 17 additions and 8 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\world\particle;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\convert\ItemTranslator;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\ParticleIds;
@ -32,6 +33,7 @@ class ItemBreakParticle implements Particle{
public function __construct(private Item $item){}
public function encode(Vector3 $pos) : array{
return [LevelEventPacket::standardParticle(ParticleIds::ITEM_BREAK, ($this->item->getId() << 16) | $this->item->getMeta(), $pos)];
[$id, $meta] = ItemTranslator::getInstance()->toNetworkId($this->item->getId(), $this->item->getMeta());
return [LevelEventPacket::standardParticle(ParticleIds::ITEM_BREAK, ($id << 16) | $meta, $pos)];
}
}