From 9408afe98a4f78ade7a547110ff3e4ec13edd722 Mon Sep 17 00:00:00 2001 From: Agus Date: Fri, 6 Mar 2026 00:58:14 -0300 Subject: [PATCH] fix skin id assignment --- Minecraft.Client/PlayerConnection.cpp | 15 ++++----------- .../TextureAndGeometryChangePacket.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index f0e538a..1d4eda2 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -126,7 +126,7 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason) send( shared_ptr( new DisconnectPacket(reason) )); connection->sendAndQuit(); // 4J-PB - removed, since it needs to be localised in the language the client is in - //server->players->broadcastAll( shared_ptr( new ChatPacket(L"§e" + player->name + L" left the game.") ) ); + //server->players->broadcastAll( shared_ptr( new ChatPacket(L"�e" + player->name + L" left the game.") ) ); if(getWasKicked()) { server->getPlayers()->broadcastAll( shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) ); @@ -569,7 +569,7 @@ void PlayerConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason, if( done ) return; // logger.info(player.name + " lost connection: " + reason); // 4J-PB - removed, since it needs to be localised in the language the client is in - //server->players->broadcastAll( shared_ptr( new ChatPacket(L"§e" + player->name + L" left the game.") ) ); + //server->players->broadcastAll( shared_ptr( new ChatPacket(L"�e" + player->name + L" left the game.") ) ); if(getWasKicked()) { server->getPlayers()->broadcastAll( shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) ); @@ -740,13 +740,13 @@ int PlayerConnection::countDelayedPackets() void PlayerConnection::info(const wstring& string) { // 4J-PB - removed, since it needs to be localised in the language the client is in - //send( shared_ptr( new ChatPacket(L"§7" + string) ) ); + //send( shared_ptr( new ChatPacket(L"�7" + string) ) ); } void PlayerConnection::warn(const wstring& string) { // 4J-PB - removed, since it needs to be localised in the language the client is in - //send( shared_ptr( new ChatPacket(L"§9" + string) ) ); + //send( shared_ptr( new ChatPacket(L"�9" + string) ) ); } wstring PlayerConnection::getConsoleName() @@ -1000,14 +1000,7 @@ void PlayerConnection::handleTextureAndGeometryChange(shared_ptrpath.empty() && app.IsFileInMemoryTextures(packet->path)) { - // Update the ref count on the memory texture data app.AddMemoryTextureFile(packet->path,NULL,0); - - player->setCustomSkin(packet->dwSkinID); - - // If we already have the texture, then we already have the model parts too - //app.SetAdditionalSkinBoxes(packet->dwSkinID,) - //DebugBreak(); } server->getPlayers()->broadcastAll( shared_ptr( new TextureAndGeometryChangePacket(player,packet->path) ), player->dimension ); } diff --git a/Minecraft.World/TextureAndGeometryChangePacket.cpp b/Minecraft.World/TextureAndGeometryChangePacket.cpp index 04c88be..cc34f1d 100644 --- a/Minecraft.World/TextureAndGeometryChangePacket.cpp +++ b/Minecraft.World/TextureAndGeometryChangePacket.cpp @@ -22,9 +22,13 @@ TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(shared_ptr= 3) && (path.substr(0, 3).compare(L"dlc") == 0); + if (isDlcSkin) + ss << std::dec << skinValue.c_str(); + else + ss << std::hex << skinValue.c_str(); ss >> dwSkinID; - dwSkinID = MAKE_SKIN_BITMASK(true, dwSkinID); + dwSkinID = MAKE_SKIN_BITMASK(isDlcSkin, dwSkinID); }