From e11c40f64527425f64fe50d3a32bf7e41429a114 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Mon, 26 Dec 2022 02:16:24 +0300 Subject: [PATCH] changed pathfinder(hopefully one last time) --- src/astarnavigator/ArrayList.php | 40 +++++ src/astarnavigator/IElement.php | 7 + src/astarnavigator/ITileNavigator.php | 7 + src/astarnavigator/PHPUtils.php | 12 ++ src/astarnavigator/PathTile.php | 27 +++ src/astarnavigator/PathTileXYZ.php | 38 ++++ src/astarnavigator/TileNavigator.php | 84 +++++++++ .../algorithms/IDistanceAlgorithm.php | 7 + .../algorithms/ManhattanHeuristic3D.php | 14 ++ .../ManhattanHeuristicAlgorithm.php | 12 ++ .../algorithms/Pythagoras3D.php | 14 ++ .../algorithms/PythagorasAlgorithm.php | 11 ++ .../providers/DiagonalNeighborProvider.php | 17 ++ .../providers/EmptyBlockedProvider.php | 10 ++ .../providers/IBlockedProvider.php | 12 ++ .../providers/INeighborProvider.php | 7 + .../providers/MCBlockedProvider.php | 16 ++ .../providers/MCDiagonalProvider.php | 22 +++ src/dependencies.php | 20 ++- src/entity/Creature.php | 18 +- src/entity/Living.php | 6 +- src/entity/ai/MobController.php | 7 +- src/pmf/PMFLevel.php | 1 - src/utils/pathfinder/MinecraftNode.php | 102 ----------- src/utils/pathfinder/astar/AStar.php | 167 ------------------ src/utils/pathfinder/astar/Node.php | 136 -------------- src/world/MobSpawner.php | 1 + start.cmd | 2 +- 28 files changed, 401 insertions(+), 416 deletions(-) create mode 100644 src/astarnavigator/ArrayList.php create mode 100644 src/astarnavigator/IElement.php create mode 100644 src/astarnavigator/ITileNavigator.php create mode 100644 src/astarnavigator/PHPUtils.php create mode 100644 src/astarnavigator/PathTile.php create mode 100644 src/astarnavigator/PathTileXYZ.php create mode 100644 src/astarnavigator/TileNavigator.php create mode 100644 src/astarnavigator/algorithms/IDistanceAlgorithm.php create mode 100644 src/astarnavigator/algorithms/ManhattanHeuristic3D.php create mode 100644 src/astarnavigator/algorithms/ManhattanHeuristicAlgorithm.php create mode 100644 src/astarnavigator/algorithms/Pythagoras3D.php create mode 100644 src/astarnavigator/algorithms/PythagorasAlgorithm.php create mode 100644 src/astarnavigator/providers/DiagonalNeighborProvider.php create mode 100644 src/astarnavigator/providers/EmptyBlockedProvider.php create mode 100644 src/astarnavigator/providers/IBlockedProvider.php create mode 100644 src/astarnavigator/providers/INeighborProvider.php create mode 100644 src/astarnavigator/providers/MCBlockedProvider.php create mode 100644 src/astarnavigator/providers/MCDiagonalProvider.php delete mode 100644 src/utils/pathfinder/MinecraftNode.php delete mode 100644 src/utils/pathfinder/astar/AStar.php delete mode 100644 src/utils/pathfinder/astar/Node.php diff --git a/src/astarnavigator/ArrayList.php b/src/astarnavigator/ArrayList.php new file mode 100644 index 00000000..4f8a2c85 --- /dev/null +++ b/src/astarnavigator/ArrayList.php @@ -0,0 +1,40 @@ +arr[$e->__toString()] = $e; + return $this; + } + + public function addAll($es){ + foreach($es as $e){ + $this->add($this->add($e)); + } + } + + public function getFirst(){ + return array_values($this->arr)[0]; + } + + public function remove(IElement $e){ + unset($this->arr[$e->__toString()]); + return $this; + } + + public function __isset($e){ + return isset($this->arr[$e->__toString()]); + } + + public function has(IElement $e){ + return isset($this->arr[$e->__toString()]); + } + + public function sortWith($func){ + return uasort($this->arr, $func); + } + + public function countElements(){ + return count($this->arr); + } +} diff --git a/src/astarnavigator/IElement.php b/src/astarnavigator/IElement.php new file mode 100644 index 00000000..e88c21ba --- /dev/null +++ b/src/astarnavigator/IElement.php @@ -0,0 +1,7 @@ +x = $x; + $this->y = $y; + } + + public function equals(PathTile $t){ + return $t->x === $this->x && $t->y === $this->y; + } + + public function addOffset($offset){ + $this->x += $offset[0]; + $this->y += $offset[1]; + return $this; + } + + public function __toString(){ + return $this->x.":".$this->y; + } + +} + diff --git a/src/astarnavigator/PathTileXYZ.php b/src/astarnavigator/PathTileXYZ.php new file mode 100644 index 00000000..4134f3fb --- /dev/null +++ b/src/astarnavigator/PathTileXYZ.php @@ -0,0 +1,38 @@ +x = floor($x); + $this->y = floor($y); + $this->z = floor($z); + $this->level = $level; + } + + public function equals(PathTile $t){ + return $t->x === $this->x && $t->y === $this->y && $t->z === $this->z; + } + + public function asVector(){ + return new Vector3($this->x, $this->y, $this->z); + } + + public function addOffset($offset){ + $this->x += $offset[0]; + $this->y += $offset[1]; + $this->z += $offset[2]; + return $this; + } + + public function __toString(){ + return $this->x.":".$this->y.":".$this->z; + } +} + diff --git a/src/astarnavigator/TileNavigator.php b/src/astarnavigator/TileNavigator.php new file mode 100644 index 00000000..4138d848 --- /dev/null +++ b/src/astarnavigator/TileNavigator.php @@ -0,0 +1,84 @@ +blockedProvider = $blockedProvider; + $this->neighborProvider = $neighborProvider; + $this->distanceAlgorithm = $distanceAlgorithm; + $this->heuristicAlgorithm = $heuristicAlgorithm; + } + + public function reconstructPath($path, $current){ + $totalPath = [$current]; + while (array_key_exists((string)$current, $path)) + { + $current = $path[(string)$current]; + $totalPath[] = $current; + } + + $totalPath = array_reverse($totalPath); + unset($totalPath[0]); + + return array_values($totalPath); + } + + public function navigate(PathTile $from, PathTile $to) + { + $closed = new ArrayList(); + $open = new ArrayList(); + $open->add($from); + $path = []; //new Dictionary(); + $gScore = []; //new Dictionary(); + $gScore[(string) $from] = 0; + /** + * @var array[Tile] $fScore + */ + $fScore = [];//new Dictionary(); + $fScore[(string) $from] = $this->heuristicAlgorithm->calculate($from, $to); + if($this->blockedProvider->isBlocked($to)){ + return null; + } + while($open->countElements() > 0) + { + //sleep(1); + $open->sortWith(function($k, $k1) use ($fScore){ + return $fScore[(string)$k] === $fScore[(string)$k1] ? 0 : ($fScore[(string)$k] > $fScore[(string)$k1] ? 1 : -1); + }); + $current = $open->getFirst(); + if ($current->equals($to)){ + return $this->reconstructPath($path, $current); + } + $open->remove($current); + $closed->add($current); + foreach($this->neighborProvider->getNeighbors($current) as $neighbor) + { + + if ($closed->has($neighbor) || $this->blockedProvider->isBlocked($neighbor)) + { + continue; + } + + $tentativeG = $gScore[(string) $current] + $this->distanceAlgorithm->calculate($current, $neighbor); + + if (!$open->has($neighbor)) + { + $open->add($neighbor); + } + else if ($tentativeG >= $gScore[(string) $neighbor]) + { + continue; + } + $path[(string) $neighbor] = $current; + $gScore[(string) $neighbor] = $tentativeG; + $fScore[(string) $neighbor] = $gScore[(string) $neighbor] + $this->heuristicAlgorithm->calculate($neighbor, $to); + } + } + + return null; + } + + +} + diff --git a/src/astarnavigator/algorithms/IDistanceAlgorithm.php b/src/astarnavigator/algorithms/IDistanceAlgorithm.php new file mode 100644 index 00000000..b0eb6848 --- /dev/null +++ b/src/astarnavigator/algorithms/IDistanceAlgorithm.php @@ -0,0 +1,7 @@ +asVector(), $to->asVector()); + } + return 666; + } + +} + diff --git a/src/astarnavigator/algorithms/ManhattanHeuristicAlgorithm.php b/src/astarnavigator/algorithms/ManhattanHeuristicAlgorithm.php new file mode 100644 index 00000000..744748f4 --- /dev/null +++ b/src/astarnavigator/algorithms/ManhattanHeuristicAlgorithm.php @@ -0,0 +1,12 @@ +x - $to->x) + abs($from->y - $to->y); + } + + +} + diff --git a/src/astarnavigator/algorithms/Pythagoras3D.php b/src/astarnavigator/algorithms/Pythagoras3D.php new file mode 100644 index 00000000..aff091fe --- /dev/null +++ b/src/astarnavigator/algorithms/Pythagoras3D.php @@ -0,0 +1,14 @@ +asVector(), $to->asVector()); + } + return 666; + } + +} + diff --git a/src/astarnavigator/algorithms/PythagorasAlgorithm.php b/src/astarnavigator/algorithms/PythagorasAlgorithm.php new file mode 100644 index 00000000..609ac1d4 --- /dev/null +++ b/src/astarnavigator/algorithms/PythagorasAlgorithm.php @@ -0,0 +1,11 @@ +x - $from->x, 2) + pow($to->y - $from->y, 2)); + } + +} + diff --git a/src/astarnavigator/providers/DiagonalNeighborProvider.php b/src/astarnavigator/providers/DiagonalNeighborProvider.php new file mode 100644 index 00000000..7a0b7808 --- /dev/null +++ b/src/astarnavigator/providers/DiagonalNeighborProvider.php @@ -0,0 +1,17 @@ +addOffset($offset); + } + return $result; + } + +} + diff --git a/src/astarnavigator/providers/EmptyBlockedProvider.php b/src/astarnavigator/providers/EmptyBlockedProvider.php new file mode 100644 index 00000000..bf4a0a7e --- /dev/null +++ b/src/astarnavigator/providers/EmptyBlockedProvider.php @@ -0,0 +1,10 @@ +level->getBlockWithoutVector($tile->x, $tile->y, $tile->z); + return $b instanceof Block && $b->isSolid; + } + return false; + } + +} + diff --git a/src/astarnavigator/providers/MCDiagonalProvider.php b/src/astarnavigator/providers/MCDiagonalProvider.php new file mode 100644 index 00000000..519b4877 --- /dev/null +++ b/src/astarnavigator/providers/MCDiagonalProvider.php @@ -0,0 +1,22 @@ +addOffset($offset); + } + return $result; + } + return []; + } + + +} + diff --git a/src/dependencies.php b/src/dependencies.php index d022c015..c10c553f 100644 --- a/src/dependencies.php +++ b/src/dependencies.php @@ -77,8 +77,24 @@ require_once(FILE_PATH . "/src/math/Vector3.php"); require_once(FILE_PATH . "/src/world/Position.php"); require_once(FILE_PATH . "/src/pmf/PMF.php"); -require_once(FILE_PATH . "/src/utils/pathfinder/astar/Node.php"); -require_once(FILE_PATH . "/src/utils/pathfinder/astar/AStar.php"); +require_once(FILE_PATH . "/src/astarnavigator/IElement.php"); +require_once(FILE_PATH . "/src/astarnavigator/PHPUtils.php"); +require_once(FILE_PATH . "/src/astarnavigator/PathTile.php"); +require_once(FILE_PATH . "/src/astarnavigator/ArrayList.php"); + +require_once(FILE_PATH . "/src/astarnavigator/algorithms/IDistanceAlgorithm.php"); +require_once(FILE_PATH . "/src/astarnavigator/algorithms/PythagorasAlgorithm.php"); +require_once(FILE_PATH . "/src/astarnavigator/algorithms/ManhattanHeuristicAlgorithm.php"); + +require_once(FILE_PATH . "/src/astarnavigator/providers/INeighborProvider.php"); +require_once(FILE_PATH . "/src/astarnavigator/providers/DiagonalNeighborProvider.php"); + +require_once(FILE_PATH . "/src/astarnavigator/providers/IBlockedProvider.php"); +require_once(FILE_PATH . "/src/astarnavigator/providers/EmptyBlockedProvider.php"); + +require_once(FILE_PATH . "/src/astarnavigator/ITileNavigator.php"); +require_once(FILE_PATH . "/src/astarnavigator/TileNavigator.php"); + require_once(FILE_PATH . "/src/entity/ai/tasks/TaskBase.php"); diff --git a/src/entity/Creature.php b/src/entity/Creature.php index 12c2195c..7949610c 100644 --- a/src/entity/Creature.php +++ b/src/entity/Creature.php @@ -6,10 +6,13 @@ move methods abstract class Creature extends Living{ const CLASS_TYPE = ENTITY_MOB; + public $pathFinder, $path = null, $currentIndex = 0, $currentNode; + public $inPanic; public function __construct(Level $level, $eid, $class, $type = 0, $data = []){ $this->inPanic = false; //force for now + $this->pathFinder = new TileNavigator(new MCBlockedProvider(), new MCDiagonalProvider(), new Pythagoras3D(), new ManhattanHeuristic3D()); parent::__construct($level, $eid, $class, $type, $data); $this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 1, "generic"); //$this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type)); @@ -18,11 +21,24 @@ abstract class Creature extends Living{ $this->ai->addTask(new TaskRandomWalk()); $this->ai->addTask(new TaskLookAtPlayer()); } + } public function update(){ + /*if($this->path === null && $this->pathFinder instanceof ITileNavigator){ + $this->path = $this->pathFinder->navigate(new PathTileXYZ($this->x, $this->y, $this->z, $this->level), new PathTileXYZ($this->x + mt_rand(-7, 7), $this->y, $this->z + mt_rand(-7, 7), $this->level)); + } + if(is_array($this->path) && count($this->path) <= 0 || $this->currentIndex >= count($this->path)){ + $this->path = null; + $this->currentIndex = 0; + $this->currentNode = false; + }elseif($this->currentNode == false || $this->ai->mobController->moveTo($this->currentNode->x, $this->currentNode->y, $this->currentNode->z) === false){ + console("this"); + $this->currentNode = $this->path[$this->currentIndex++]; + }*/ + + /*if($this->path === false || count($this->path) <= 0){ - $this->path = $this->pathFinder->findPath(MinecraftNode::fromArray([$this->x, $this->y, $this->z]), new MinecraftNode($this->x + mt_rand(-7, 7), $this->y, $this->z + mt_rand(-7, 7))); } $state = $this->pathNavigator->followPath($this->path); if($state === PathNavigator::PATH_COMPLETED){ diff --git a/src/entity/Living.php b/src/entity/Living.php index 164fa10d..3a841167 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -1,14 +1,10 @@ pathFinder = new AStar($this); - $this->pathFound = false; $this->target = false; - $this->path = null; $this->ai = new EntityAI($this); - $this->pathNavigator = new PathNavigator($this); parent::__construct($level, $eid, $class, $type, $data); $this->canBeAttacked = true; $this->hasGravity = true; diff --git a/src/entity/ai/MobController.php b/src/entity/ai/MobController.php index 25b5fb3b..ec108e8c 100644 --- a/src/entity/ai/MobController.php +++ b/src/entity/ai/MobController.php @@ -12,9 +12,10 @@ class MobController } public function moveNonInstant($x, $y, $z){ - if($x === $this->entity->x && $y === $this->entity->y && $z === $this->entity->z){ + if($x == 0 && $y == 0 && $z == 0){ return false; //failed } + $ox = ($x > 0 ? 1 : ($x < 0 ? -1 : 0)); $oy = ($y > 0 ? 1 : ($y < 0 ? -1 : 0)); $oz = ($z > 0 ? 1 : ($z < 0 ? -1 : 0)); @@ -27,6 +28,10 @@ class MobController return true; } + public function moveTo($x, $y, $z){ + return $this->moveNonInstant($x - floor($this->entity->x), $y - floor($this->entity->y), $z - floor($this->entity->z)); + } + public function faceEntity(Vector3 $v){ $d = $v->subtract($this->entity)->normalize(); $dx = $d->x; diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index c3b8bbef..e5b413b1 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -440,7 +440,6 @@ class PMFLevel extends PMF{ $b = ord($this->chunks[$index][$Y][(int) ($aY + ($aX << 5) + ($aZ << 9))]); $m = ord($this->chunks[$index][$Y][(int) (($aY >> 1) + 16 + ($aX << 5) + ($aZ << 9))]); }else{ - console(get_class($this->chunks[$index][$Y])); $b = 0; $m = 0; } diff --git a/src/utils/pathfinder/MinecraftNode.php b/src/utils/pathfinder/MinecraftNode.php deleted file mode 100644 index 4d5345af..00000000 --- a/src/utils/pathfinder/MinecraftNode.php +++ /dev/null @@ -1,102 +0,0 @@ -x}, {$this->y}, {$this->z})"; - } - public function add($x = 0, $y = 0, $z = 0){ - return new MinecraftNode($x+$this->x, $y+$this->y, $z+$this->z); - } - /** - * {@inheritDoc} - * @see Node::getOwnCost() - */ - public function getOwnCost() - { - return 1; - } - - public function getParentAndCleanSelf(){ - try{ - return $this->parent; - }finally{ - $this->parent = null; - $this->nodes = null; - } - } - - public function generateAdjNodes(AStar $pf) - { - $this->nodes = []; - for($x = -1; $x <= 1; $x++){ - for($z = -1; $z <= 1; $z++){ - $node = new MinecraftNode($x + $this->x, $this->y, $z + $this->z); - if(!$node->canMoveHere($pf)){ - //console("[DEBUG] Obstacle at $node"); - continue; - } - $this->nodes[] = $node; - } - } - } - - /** - * {@inheritDoc} - * @see Node::getAdjacentNodes() - */ - public function getAdjacentNodes(AStar $pf) - { - if($this->nodes === null){ - $this->generateAdjNodes($pf); - } - return $this->nodes; - } - - /** - * {@inheritDoc} - * @see Node::equals() - */ - public function equals(Node $node) - { - return $node->x === $this->x && $this->z === $node->z; - } - - - /** - * {@inheritDoc} - * @see Node::getHCost() - */ - public function getHCost(Node $target) - { - return abs($target->x - $this->x) + abs($target->z - $this->z); - } - - /** - * {@inheritDoc} - * @see Node::canMoveHere() - */ - - public function canMoveHere(AStar $pf) - { - return !$pf->entity->level->getBlockWithoutVector($this->x, $this->y, $this->z)->isSolid; - } - - -} - diff --git a/src/utils/pathfinder/astar/AStar.php b/src/utils/pathfinder/astar/AStar.php deleted file mode 100644 index 6a30395d..00000000 --- a/src/utils/pathfinder/astar/AStar.php +++ /dev/null @@ -1,167 +0,0 @@ -entity = $entity; - } - - /** - * find a path from Node $start to Node $end - * @param Node $start - * @param Node $end - * @param number $maxOffset - * @return array|Node[] - */ - public function findPath(Node $start, Node $end) - { - // no path if there is no need for moving - if ($start->equals($end)) { - //console("[DEBUG] $start equals $end, route is empty"); - return []; - } - if(!$end->canMoveHere($this)){ - //console("[DEBUG] $end is not accessible, path will not be found"); - return false; - } - $maxOffsetX = abs($start->x - $end->x); - $maxOffsetZ = abs($start->z - $end->z); - - $this->addToOpen($start); - - $foundTarget = false; - - while (!$foundTarget && count($this->open) > 0) { - //console("[DEBUG] sorting open nodes by cost. Node count:" . count($this->open)); - uasort( - $this->open, - function (Node $a, Node $b) use ($end) { - return $a->getFCost($end) - $b->getFCost($end); - } - ); - - /** @var Node $current */ - $current = $this->open[array_keys($this->open)[0]]; - unset($this->open[array_keys($this->open)[0]]); - - //console("[DEBUG] current node selected: " . $current); - - if ((string)$current == (string)$end) { - $foundTarget = $current; - //console("[DEBUG] current node is target node, exiting loop"); - continue; - } - - $adjacent = $current->getAdjacentNodes($this); - - foreach ($adjacent as $node) { - if (in_array((string)$node, $this->closed)) { - //console("[DEBUG] skipping adjacent: $node as it was already processed"); - continue; - } - $node->setParent($current); - $this->addToOpen($node); - } - $this->addToClosed($current); - - } - - // we failed to find a route - if (!$foundTarget && count($this->open) == 0) { - //console("[DEBUG] no open nodes left, and no target found."); - return false; - } - - //console("[DEBUG] found route!"); - /** @var Node $foundTarget */ - try{ - return $this->createRouteList($foundTarget); - }finally{ //removing all elements from them - $this->closed = []; - $this->open = []; - } - - } - - /** - * @param Node $node - */ - protected function addToOpen(Node $node) - { - if ( - isset($this->open[(string)$node]) - && $this->open[(string)$node]->getGCost() < $node->getGCost() - ) { - //console("[DEBUG] skipping add, $node is already known and gcost <= new path"); - return; - } - //console("[DEBUG] adding new open node: $node"); - $this->open[(string)$node] = $node; - } - - /** - * @param Node $node - */ - protected function addToClosed(Node $node) - { - //console("[DEBUG] adding $node to closed"); - $this->closed[] = (string)$node; - } - - /** - * @param Node $foundTarget - * @return Node[] - */ - protected function createRouteList(Node $foundTarget) - { - $route = []; - $route[] = $foundTarget; - - while ($foundTarget = $foundTarget->getParentAndCleanSelf()) { - $route[] = $foundTarget; - } - $route = array_reverse($route); - - return $route; - } -} \ No newline at end of file diff --git a/src/utils/pathfinder/astar/Node.php b/src/utils/pathfinder/astar/Node.php deleted file mode 100644 index b0810fa2..00000000 --- a/src/utils/pathfinder/astar/Node.php +++ /dev/null @@ -1,136 +0,0 @@ -parent = $parent; - } - - /** - * @return Node|bool - */ - public function getParent() - { - return $this->parent; - } - - public function getParentAndCleanSelf(){ - try{ - return $this->parent; - }finally{ - $this->parent = null; - } - } - - /** - * @return int|float - */ - public function getGCost() - { - if(is_null($this->gCost)) { - $this->gCost = - $this->parent ? $this->parent->getGCost() + $this->getOwnCost() : $this->getOwnCost(); - } - - return $this->gCost; - } - - /** - * @param Node $target - * @return float|int - */ - public function getFCost(Node $target) - { - return $this->getGCost() + $this->getHCost($target); - } - - /** - * @return int|float - */ - abstract public function getOwnCost(); - - /** - * @param Node $target - * @return int|float - */ - abstract public function getHCost(Node $target); - - /** - * @param AStar $pf - * @return Node[] - */ - abstract public function getAdjacentNodes(AStar $pf); - - /** - * @param Node $compareTo - * @return bool - */ - abstract public function equals(Node $compareTo); - - /** - * Check can this point be used - * @param AStar $pf - * @return bool - */ - abstract public function canMoveHere(AStar $pf); - - /** - * should return a unique string for this - * - * @return string - */ - public function __toString(){ - return parent::__toString(); - } - - /** - * this method should allow a node - * to get the data from the target node getHostCost requires for its heuristic (if needed) - * - * @return array - */ - public function getDataForH() - { - return []; - } -} \ No newline at end of file diff --git a/src/world/MobSpawner.php b/src/world/MobSpawner.php index 25f4e42d..af77da8b 100644 --- a/src/world/MobSpawner.php +++ b/src/world/MobSpawner.php @@ -20,6 +20,7 @@ class MobSpawner{ } public function handle(){ + return false; if($this->countEntities() > self::MOB_LIMIT || count($this->level->players) <= 0){ return false; //not spawning } diff --git a/start.cmd b/start.cmd index 3bc40264..67376028 100644 --- a/start.cmd +++ b/start.cmd @@ -3,7 +3,7 @@ TITLE NostalgiaCore server software for Minecraft: Pocket Edition cd /d %~dp0 if exist bin\php\php.exe ( if exist bin\mintty.exe ( - start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o CursorType=0 -o CursorBlinks=1 -h error -t "NostalgiaCore" -i bin/pocketmine.ico -w max bin\php\php.exe -d enable_dl=On PocketMine-MP.php --enable-ansi %* + start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o CursorType=0 -o CursorBlinks=1 -h error -t "NostalgiaCore" -i bin/pocketmine.ico -w max bin\php8test\php.exe -d enable_dl=On PocketMine-MP.php --enable-ansi %* ) else ( bin\php\php.exe -d enable_dl=On PocketMine-MP.php %* )