We use Minecraft 1.15.2 for both server and client.
Your PC have a speical address and it never changed "localhost" or "127.0.0.1".
Please follow steps below to join your Minecraft server
Open Minecraft make user use the saver version of the Minecraft server, and click "Multiplayer"
In the Multiplayer page, select Add Server
Give a server name, and put localhost
in the Server Address box"
Back to Multiplayer Screen, you will see your new added server in the list., Click that, and click "Join Server"