From 165388c8ae1c03b3b7fdf54ba81666312013ab7c Mon Sep 17 00:00:00 2001 From: Sunch <120295462+Sunch233@users.noreply.github.com> Date: Sat, 11 Jan 2025 22:22:31 +0800 Subject: [PATCH] remove some useless code --- src/PocketMinecraftServer.php | 1 - src/utils/RailLogic.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index 1e741b52..42083285 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -591,7 +591,6 @@ class PocketMinecraftServer{ $this->clients[$CID] = new Player($packet->clientID, $packet->ip, $packet->port, $packet->mtuSize); //New Session! $pk = new RakNetPacket(RakNetInfo::OPEN_CONNECTION_REPLY_2); $pk->serverID = $this->serverID; - $pk->port = $this->port; $pk->mtuSize = $packet->mtuSize; $pk->ip = $packet->ip; $pk->port = $packet->port; diff --git a/src/utils/RailLogic.php b/src/utils/RailLogic.php index 6f293a5f..92eb05ab 100644 --- a/src/utils/RailLogic.php +++ b/src/utils/RailLogic.php @@ -63,7 +63,7 @@ class RailLogic } public function canConnectTo(RailLogic $rail){ - return $this->connectsTo($rail) || ((count($this->railPositions) == 2 ? false : (empty($this->railPositions) ? true : true))); + return $this->connectsTo($rail) || !(count($this->railPositions) == 2); } public function hasNeighborRail($x, $y, $z){