Merge remote-tracking branch 'itsRevela/main'

# Conflicts:
#	.github/workflows/nightly.yml
#	.gitignore
#	Minecraft.Client/ChatScreen.cpp
#	Minecraft.Client/ClientConnection.cpp
#	Minecraft.Client/Common/Audio/SoundEngine.cpp
#	Minecraft.Client/Common/Audio/SoundEngine.h
#	Minecraft.Client/Common/Media/MediaWindows64.arc
#	Minecraft.Client/Common/UI/IUIScene_HUD.cpp
#	Minecraft.Client/Common/UI/UIControl_Base.cpp
#	Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp
#	Minecraft.Client/Common/UI/UIScene_JoinMenu.cpp
#	Minecraft.Client/Common/XUI/XUI_Chat.cpp
#	Minecraft.Client/Common/XUI/XUI_Death.cpp
#	Minecraft.Client/Font.cpp
#	Minecraft.Client/Gui.cpp
#	Minecraft.Client/PendingConnection.cpp
#	Minecraft.Client/PlayerConnection.cpp
#	Minecraft.Client/PlayerConnection.h
#	Minecraft.Client/PlayerList.cpp
#	Minecraft.Client/Windows64/Network/WinsockNetLayer.cpp
#	Minecraft.Client/Windows64/Network/WinsockNetLayer.h
#	Minecraft.Client/Windows64Media/strings.h
#	Minecraft.Client/cmake/sources/Common.cmake
#	Minecraft.Server/Console/ServerCliEngine.cpp
#	Minecraft.Server/Console/commands/whitelist/CliCommandWhitelist.cpp
#	Minecraft.Server/Windows64/ServerMain.cpp
#	Minecraft.World/WitherBoss.h
#	Minecraft.World/cmake/sources/Common.cmake
#	README.md
This commit is contained in:
George V. committed 2026-04-09 15:21:43 +03:00
commit 506ebd2176
220 files changed
+13703 -1209

No files matched your search

+32 -20
View File
@@ -21,6 +21,10 @@
#include "../Minecraft.World/net.minecraft.world.level.chunk.h"
#include "PlayerConnection.h"
#ifdef _WINDOWS64
extern bool g_Win64DedicatedServer;
#endif
EntityTracker::EntityTracker(ServerLevel *level)
{
this->level = level;
@@ -140,32 +144,40 @@ void EntityTracker::tick()
// 4J Stu - If one player on a system is updated, then make sure they all are as they all have their
// range extended to include entities visible by any other player on the system
// Fix for #11194 - Gameplay: Host player and their split-screen avatars can become invisible and invulnerable to client.
MinecraftServer *server = MinecraftServer::getInstance();
for( unsigned int i = 0; i < server->getPlayers()->players.size(); i++ )
// NOTE: On dedicated servers, IsSameSystem() always returns false for remote
// players (no split-screen), so this loop does nothing. Skip it entirely to
// avoid the O(players * movedPlayers) overhead.
#ifdef _WINDOWS64
if (!g_Win64DedicatedServer)
#endif
{
shared_ptr<ServerPlayer> ep = server->getPlayers()->players[i];
if( ep->dimension != level->dimension->id ) continue;
if( ep->connection == nullptr ) continue;
INetworkPlayer *thisPlayer = ep->connection->getNetworkPlayer();
if( thisPlayer == nullptr ) continue;
bool addPlayer = false;
for (unsigned int j = 0; j < movedPlayers.size(); j++)
MinecraftServer *server = MinecraftServer::getInstance();
for( unsigned int i = 0; i < server->getPlayers()->players.size(); i++ )
{
shared_ptr<ServerPlayer> sp = movedPlayers[j];
shared_ptr<ServerPlayer> ep = server->getPlayers()->players[i];
if( ep->dimension != level->dimension->id ) continue;
if( sp == ep ) break;
if( ep->connection == nullptr ) continue;
INetworkPlayer *thisPlayer = ep->connection->getNetworkPlayer();
if( thisPlayer == nullptr ) continue;
if(sp->connection == nullptr) continue;
INetworkPlayer *otherPlayer = sp->connection->getNetworkPlayer();
if( otherPlayer != nullptr && thisPlayer->IsSameSystem(otherPlayer) )
bool addPlayer = false;
for (unsigned int j = 0; j < movedPlayers.size(); j++)
{
addPlayer = true;
break;
shared_ptr<ServerPlayer> sp = movedPlayers[j];
if( sp == ep ) break;
if(sp->connection == nullptr) continue;
INetworkPlayer *otherPlayer = sp->connection->getNetworkPlayer();
if( otherPlayer != nullptr && thisPlayer->IsSameSystem(otherPlayer) )
{
addPlayer = true;
break;
}
}
}
if( addPlayer ) movedPlayers.push_back( ep );
if( addPlayer ) movedPlayers.push_back( ep );
}
}
for (unsigned int i = 0; i < movedPlayers.size(); i++)