mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
duct tape for block ID remapping
This commit is contained in:
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\LevelEventPacket;
|
||||
|
||||
@ -33,7 +34,7 @@ class DestroyBlockParticle extends Particle{
|
||||
|
||||
public function __construct(Vector3 $pos, Block $b){
|
||||
parent::__construct($pos->x, $pos->y, $pos->z);
|
||||
$this->data = $b->getId() | ($b->getDamage() << 8);
|
||||
$this->data = BlockFactory::toStaticRuntimeId($b->getId(), $b->getDamage());
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
@ -24,10 +24,11 @@ declare(strict_types=1);
|
||||
namespace pocketmine\level\particle;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\math\Vector3;
|
||||
|
||||
class TerrainParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, Block $b){
|
||||
parent::__construct($pos, Particle::TYPE_TERRAIN, ($b->getDamage() << 8) | $b->getId());
|
||||
parent::__construct($pos, Particle::TYPE_TERRAIN, BlockFactory::toStaticRuntimeId($b->getId(), $b->getDamage()));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user