mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +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:
@ -248,13 +248,13 @@ abstract class Liquid extends Transparent{
|
||||
|
||||
if($newDecay !== $this->decay or $falling !== $this->falling){
|
||||
if(!$falling and $newDecay < 0){
|
||||
$this->level->setBlock($this, BlockFactory::get(Block::AIR), true, true);
|
||||
$this->level->setBlock($this, BlockFactory::get(Block::AIR));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->falling = $falling;
|
||||
$this->decay = $falling ? 0 : $newDecay;
|
||||
$this->level->setBlock($this, $this, true, true); //local block update will cause an update to be scheduled
|
||||
$this->level->setBlock($this, $this); //local block update will cause an update to be scheduled
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ abstract class Liquid extends Transparent{
|
||||
$new = clone $this;
|
||||
$new->falling = $falling;
|
||||
$new->decay = $falling ? 0 : $newFlowDecay;
|
||||
$this->level->setBlock($block, $new, true, true);
|
||||
$this->level->setBlock($block, $new);
|
||||
}
|
||||
}
|
||||
|
||||
@ -432,7 +432,7 @@ abstract class Liquid extends Transparent{
|
||||
protected function liquidCollide(Block $cause, Block $result) : bool{
|
||||
//TODO: add events
|
||||
|
||||
$this->level->setBlock($this, $result, true, true);
|
||||
$this->level->setBlock($this, $result);
|
||||
$this->level->broadcastLevelSoundEvent($this->add(0.5, 0.5, 0.5), LevelSoundEventPacket::SOUND_FIZZ, (int) ((2.6 + (lcg_value() - lcg_value()) * 0.8) * 1000));
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user