Fixed a couple of repeated Level->getBlock() calls in Liquid

This commit is contained in:
Dylan K. Taylor 2017-05-06 18:57:34 +01:00
parent e72d8cf8f5
commit a95d173989

View File

@ -216,7 +216,7 @@ abstract class Liquid extends Transparent{
$k = -1; $k = -1;
} }
if(($topFlowDecay = $this->getFlowDecay($this->level->getBlock($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y + 1, $this->z))))) >= 0){ if(($topFlowDecay = $this->getFlowDecay($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y + 1, $this->z)))) >= 0){
if($topFlowDecay >= 8){ if($topFlowDecay >= 8){
$k = $topFlowDecay; $k = $topFlowDecay;
}else{ }else{
@ -225,7 +225,7 @@ abstract class Liquid extends Transparent{
} }
if($this->adjacentSources >= 2 and $this instanceof Water){ if($this->adjacentSources >= 2 and $this instanceof Water){
$bottomBlock = $this->level->getBlock($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y - 1, $this->z))); $bottomBlock = $this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y - 1, $this->z));
if($bottomBlock->isSolid()){ if($bottomBlock->isSolid()){
$k = 0; $k = 0;
}elseif($bottomBlock instanceof Water and $bottomBlock->getDamage() === 0){ }elseif($bottomBlock instanceof Water and $bottomBlock->getDamage() === 0){