mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-17 08:54:22 +00:00
MinimumCostFlowCalculator: fix bug caused by recent change
This commit is contained in:
parent
027f7e249b
commit
6b2ab15ea1
@ -26,7 +26,7 @@ namespace pocketmine\block\utils;
|
|||||||
use pocketmine\block\Block;
|
use pocketmine\block\Block;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
use pocketmine\world\World;
|
use pocketmine\world\World;
|
||||||
use function array_fill;
|
use function array_fill_keys;
|
||||||
use function intdiv;
|
use function intdiv;
|
||||||
use function min;
|
use function min;
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ final class MinimumCostFlowCalculator{
|
|||||||
* @return int[]
|
* @return int[]
|
||||||
*/
|
*/
|
||||||
public function getOptimalFlowDirections(int $originX, int $originY, int $originZ) : array{
|
public function getOptimalFlowDirections(int $originX, int $originY, int $originZ) : array{
|
||||||
$flowCost = array_fill(0, 4, 1000);
|
$flowCost = array_fill_keys(Facing::HORIZONTAL, 1000);
|
||||||
$maxCost = intdiv(4, $this->flowDecayPerBlock);
|
$maxCost = intdiv(4, $this->flowDecayPerBlock);
|
||||||
foreach(Facing::HORIZONTAL as $j){
|
foreach(Facing::HORIZONTAL as $j){
|
||||||
$x = $originX;
|
$x = $originX;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user