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

@ -60,6 +60,7 @@
#include "Common/Network/PlatformNetworkManagerStub.h"
#endif
#include "../Minecraft.World/Recipes.h"
#ifdef _DURANGO
#include "../Minecraft.World/DurangoStats.h"
@ -244,6 +245,10 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
iUserID=m_userIndex;
TelemetryManager->SetMultiplayerInstanceId(packet->m_multiplayerInstanceId);
if (Recipes::getInstance()->m_bPendingRecipeRebuild) {
Recipes::getInstance()->rebuildRecipeArray();
}
}
else
{
@ -2013,6 +2018,7 @@ void ClientConnection::handleEntityActionAtPosition(shared_ptr<EntityActionAtPos
void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
{
// printf("Client: handlePreLogin\n");
Recipes::getInstance()->m_bPendingRecipeRebuild = true;
#if 1
// 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set
BOOL canPlay = TRUE;
@ -3742,7 +3748,12 @@ void ClientConnection::handleSoundEvent(shared_ptr<LevelSoundPacket> packet)
void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> customPayloadPacket)
{
if (CustomPayloadPacket::TRADER_LIST_PACKET.compare(customPayloadPacket->identifier) == 0)
if (CustomPayloadPacket::UPDATE_CRAFTING_RECIPES_PACKET.compare(customPayloadPacket->identifier) == 0)
{
Recipes::getInstance()->rebuildRecipeArray(customPayloadPacket);
Recipes::getInstance()->m_bPendingRecipeRebuild = false;
}
else if (CustomPayloadPacket::TRADER_LIST_PACKET.compare(customPayloadPacket->identifier) == 0)
{
ByteArrayInputStream bais(customPayloadPacket->data);
DataInputStream input(&bais);