mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
remove GenericParticle, work on isolating network crap in particles
This commit is contained in:
@ -24,10 +24,19 @@ declare(strict_types=1);
|
||||
namespace pocketmine\world\particle;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\LevelEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\ParticleIds;
|
||||
|
||||
class ItemBreakParticle extends GenericParticle{
|
||||
class ItemBreakParticle implements Particle{
|
||||
/** @var Item */
|
||||
private $item;
|
||||
|
||||
public function __construct(Item $item){
|
||||
parent::__construct(ParticleIds::ITEM_BREAK, ($item->getId() << 16) | $item->getMeta());
|
||||
$this->item = $item;
|
||||
}
|
||||
|
||||
public function encode(Vector3 $pos){
|
||||
return LevelEventPacket::standardParticle(ParticleIds::ITEM_BREAK, ($this->item->getId() << 16) | $this->item->getMeta(), $pos);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user