mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 02:21:46 +00:00
Liquid: use facing instead of hardcoded integers
This commit is contained in:
parent
576c33ee8f
commit
18de35ffc7
@ -177,21 +177,17 @@ abstract class Liquid extends Transparent{
|
|||||||
|
|
||||||
$world = $this->position->getWorld();
|
$world = $this->position->getWorld();
|
||||||
|
|
||||||
for($j = 0; $j < 4; ++$j){
|
foreach(Facing::HORIZONTAL as $j){
|
||||||
|
|
||||||
$x = $this->position->x;
|
$x = $this->position->x;
|
||||||
$y = $this->position->y;
|
$y = $this->position->y;
|
||||||
$z = $this->position->z;
|
$z = $this->position->z;
|
||||||
|
|
||||||
if($j === 0){
|
match($j){
|
||||||
--$x;
|
Facing::WEST => --$x,
|
||||||
}elseif($j === 1){
|
Facing::EAST => ++$x,
|
||||||
++$x;
|
Facing::NORTH => --$z,
|
||||||
}elseif($j === 2){
|
Facing::SOUTH => ++$z
|
||||||
--$z;
|
};
|
||||||
}elseif($j === 3){
|
|
||||||
++$z;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sideBlock = $world->getBlockAt($x, $y, $z);
|
$sideBlock = $world->getBlockAt($x, $y, $z);
|
||||||
$blockDecay = $this->getEffectiveFlowDecay($sideBlock);
|
$blockDecay = $this->getEffectiveFlowDecay($sideBlock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user