234 $this->checkForHarden();
237 if($this->temporalVector === null){
238 $this->temporalVector =
new Vector3(0, 0, 0);
242 $multiplier = $this instanceof Lava ? 2 : 1;
247 $smallestFlowDecay = -100;
248 $this->adjacentSources = 0;
249 $smallestFlowDecay = $this->getSmallestFlowDecay($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y, $this->z - 1)), $smallestFlowDecay);
250 $smallestFlowDecay = $this->getSmallestFlowDecay($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y, $this->z + 1)), $smallestFlowDecay);
251 $smallestFlowDecay = $this->getSmallestFlowDecay($this->level->getBlock($this->temporalVector->setComponents($this->x - 1, $this->y, $this->z)), $smallestFlowDecay);
252 $smallestFlowDecay = $this->getSmallestFlowDecay($this->level->getBlock($this->temporalVector->setComponents($this->x + 1, $this->y, $this->z)), $smallestFlowDecay);
254 $k = $smallestFlowDecay + $multiplier;
256 if($k >= 8 or $smallestFlowDecay < 0){
260 if(($topFlowDecay = $this->
getFlowDecay($this->level->getBlock($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y + 1, $this->z))))) >= 0){
261 if($topFlowDecay >= 8){
264 $k = $topFlowDecay | 0x08;
268 if($this->adjacentSources >= 2 and $this instanceof Water){
269 $bottomBlock = $this->level->getBlock($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y - 1, $this->z)));
270 if($bottomBlock->isSolid()){
272 }elseif($bottomBlock instanceof Water and $bottomBlock->getDamage() === 0){
277 if($this instanceof Lava and $decay < 8 and $k < 8 and $k > 1 and mt_rand(0, 4) !== 0){
285 $this->
getLevel()->setBlock($this,
new Air(),
true);
298 $bottomBlock = $this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y - 1, $this->z));
300 if($bottomBlock->canBeFlowedInto() or $bottomBlock instanceof Liquid){
301 if($this instanceof Lava and $bottomBlock instanceof Water){
310 $this->flowIntoBlock($bottomBlock, $decay);
314 $this->flowIntoBlock($bottomBlock, $decay | 0x08);
316 }elseif($decay >= 0 and ($decay === 0 or !$bottomBlock->canBeFlowedInto())){
317 $flags = $this->getOptimalFlowDirections();
319 $l = $decay + $multiplier;
326 $this->checkForHarden();
331 $this->flowIntoBlock($this->level->getBlock($this->temporalVector->setComponents($this->x - 1, $this->y, $this->z)), $l);
335 $this->flowIntoBlock($this->level->getBlock($this->temporalVector->setComponents($this->x + 1, $this->y, $this->z)), $l);
339 $this->flowIntoBlock($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y, $this->z - 1)), $l);
343 $this->flowIntoBlock($this->level->getBlock($this->temporalVector->setComponents($this->x, $this->y, $this->z + 1)), $l);
347 $this->checkForHarden();