mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
Liquid: fix max cost calculation for flow direction search, closes #2995
This commit is contained in:
parent
77a4393c7b
commit
11fc16617a
@ -32,6 +32,7 @@ use pocketmine\level\sound\FizzSound;
|
|||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use function array_fill;
|
use function array_fill;
|
||||||
|
use function intdiv;
|
||||||
use function lcg_value;
|
use function lcg_value;
|
||||||
use function min;
|
use function min;
|
||||||
|
|
||||||
@ -372,7 +373,7 @@ abstract class Liquid extends Transparent{
|
|||||||
*/
|
*/
|
||||||
private function getOptimalFlowDirections() : array{
|
private function getOptimalFlowDirections() : array{
|
||||||
$flowCost = array_fill(0, 4, 1000);
|
$flowCost = array_fill(0, 4, 1000);
|
||||||
$maxCost = 4 / $this->getFlowDecayPerBlock();
|
$maxCost = intdiv(4, $this->getFlowDecayPerBlock());
|
||||||
for($j = 0; $j < 4; ++$j){
|
for($j = 0; $j < 4; ++$j){
|
||||||
$x = $this->x;
|
$x = $this->x;
|
||||||
$y = $this->y;
|
$y = $this->y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user