sync recipes from server to client, only shapeless right now

This commit is contained in:
DrPerkyLegit 2026-04-24 02:25:40 -04:00
parent 12429e1981
commit f2b304fad5
7 changed files with 256 additions and 29 deletions

View file

@ -14,6 +14,7 @@
#include "../Minecraft.World/net.minecraft.world.item.h"
#include "../Minecraft.World/SharedConstants.h"
#include "Settings.h"
#include "../Minecraft.World/Recipes.h"
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#include "../Minecraft.Server/ServerLogManager.h"
#include "../Minecraft.Server/Access/Access.h"
@ -336,6 +337,7 @@ void PendingConnection::handleAcceptedLogin(shared_ptr<LoginPacket> packet)
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
ServerRuntime::ServerLogManager::OnAcceptedPlayerLogin(GetPendingConnectionSmallId(connection), name);
#endif
connection->send(std::make_shared<CustomPayloadPacket>(CustomPayloadPacket::UPDATE_CRAFTING_RECIPES_PACKET, Recipes::getInstance()->buildSyncedRecipeArray()));
server->getPlayers()->placeNewPlayer(connection, playerEntity, packet);
connection = nullptr; // We've moved responsibility for this over to the new PlayerConnection, nullptr so we don't delete our reference to it here in our dtor
}