mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Level: Remove obsolete \$direct parameter from setBlock()
this parameter was previously used to send blocks with a different set of flags, immediately, to players. However, the flags have been demonstrated useless and the direct sending is pointless now since packets are buffered now per session, so we might as well take advantage of the batched block update sending.
This commit is contained in:
@ -143,9 +143,9 @@ abstract class Door extends Transparent{
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if($this->getSide(Facing::DOWN)->getId() === self::AIR){ //Replace with common break method
|
||||
$this->getLevel()->setBlock($this, BlockFactory::get(Block::AIR), false);
|
||||
$this->getLevel()->setBlock($this, BlockFactory::get(Block::AIR));
|
||||
if($this->getSide(Facing::UP) instanceof Door){
|
||||
$this->getLevel()->setBlock($this->getSide(Facing::UP), BlockFactory::get(Block::AIR), false);
|
||||
$this->getLevel()->setBlock($this->getSide(Facing::UP), BlockFactory::get(Block::AIR));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -173,7 +173,7 @@ abstract class Door extends Transparent{
|
||||
$topHalf->top = true;
|
||||
|
||||
parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
||||
$this->level->setBlock($blockUp, $topHalf, true); //Top
|
||||
$this->level->setBlock($blockUp, $topHalf); //Top
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -187,10 +187,10 @@ abstract class Door extends Transparent{
|
||||
$other = $this->getSide($this->top ? Facing::DOWN : Facing::UP);
|
||||
if($other instanceof Door and $this->getId() === $other->getId()){
|
||||
$other->open = $this->open;
|
||||
$this->level->setBlock($other, $other, true, true);
|
||||
$this->level->setBlock($other, $other);
|
||||
}
|
||||
|
||||
$this->level->setBlock($this, $this, true, true);
|
||||
$this->level->setBlock($this, $this);
|
||||
$this->level->addSound(new DoorSound($this));
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user