Added Block->getRuntimeId(), clean up some mess

This commit is contained in:
Dylan K. Taylor
2018-09-19 16:16:10 +01:00
parent 107192c753
commit 4bc0d850b1
7 changed files with 18 additions and 20 deletions

View File

@ -24,7 +24,6 @@ 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;
@ -35,7 +34,7 @@ class DestroyBlockParticle extends Particle{
public function __construct(Vector3 $pos, Block $b){
parent::__construct($pos->x, $pos->y, $pos->z);
$this->data = BlockFactory::toStaticRuntimeId($b->getId(), $b->getDamage());
$this->data = $b->getRuntimeId();
}
public function encode(){

View File

@ -24,11 +24,10 @@ 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, BlockFactory::toStaticRuntimeId($b->getId(), $b->getDamage()));
parent::__construct($pos, Particle::TYPE_TERRAIN, $b->getRuntimeId());
}
}