From 8ecc837cfa7059526b8a1953f715e7bdfd2bffe4 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sun, 22 Mar 2026 12:56:07 -0500 Subject: [PATCH] merge Platform/Common/DLC --- .../Platform/Common/DLC/DLCManager.h | 2 ++ Minecraft.Client/Platform/Common/DLC/DLCPack.cpp | 16 +++++++++++++++- .../Platform/Common/DLC/DLCSkinFile.cpp | 14 ++++++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/Platform/Common/DLC/DLCManager.h b/Minecraft.Client/Platform/Common/DLC/DLCManager.h index 368e61fa5..4552c7b8a 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCManager.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCManager.h @@ -73,6 +73,8 @@ public: void addPack(DLCPack* pack); void removePack(DLCPack* pack); + void removeAllPacks(void); + void LanguageChanged(void); DLCPack* getPack(const std::wstring& name); #ifdef _XBOX_ONE diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp index c51cb1987..372f81240 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCPack.cpp @@ -96,7 +96,7 @@ XCONTENTDEVICEID DLCPack::GetDLCDeviceID() { void DLCPack::addChildPack(DLCPack* childPack) { const std::uint32_t packId = childPack->GetPackId(); #ifndef _CONTENT_PACKAGE - if (packId > 15) { + if (packId < 0 || packId > 15) { __debugbreak(); } #endif @@ -362,3 +362,17 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, return true; } } + +void DLCPack::UpdateLanguage() { + // find the language file + DLCManager::e_DLCType_LocalisationData; + DLCFile* file = NULL; + + if (m_files[DLCManager::e_DLCType_LocalisationData].size() > 0) { + file = m_files[DLCManager::e_DLCType_LocalisationData][0]; + DLCLocalisationFile* localisationFile = (DLCLocalisationFile*)getFile( + DLCManager::e_DLCType_LocalisationData, L"languages.loc"); + StringTable* strTable = localisationFile->getStringTable(); + strTable->ReloadStringTable(); + } +} \ No newline at end of file diff --git a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp index 54f000fff..6ea61884f 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp @@ -107,9 +107,14 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, SKIN_BOX* pSkinBox = new SKIN_BOX; ZeroMemory(pSkinBox, sizeof(SKIN_BOX)); +#ifdef __PS3__ // 4J Stu - The Xbox version used swscanf_s which isn't available in // GCC. swscanf(value.c_str(), L"%10ls%f%f%f%f%f%f%f%f", wchBodyPart, +#else + swscanf_s( + value.c_str(), L"%9ls%f%f%f%f%f%f%f%f", wchBodyPart, 10, +#endif &pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW, &pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV); @@ -130,11 +135,16 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, // add this to the skin's vector of parts m_AdditionalBoxes.push_back(pSkinBox); } break; - case DLCManager::e_DLCParamType_Anim: { + case DLCManager::e_DLCParamType_Anim: +#ifdef __PS3__ // 4J Stu - The Xbox version used swscanf_s which isn't available in // GCC. swscanf(value.c_str(), L"%X", &m_uiAnimOverrideBitmask); - std::uint32_t skinId = app.getSkinIdFromPath(m_path); +#else + swscanf_s(value.c_str(), L"%X", &m_uiAnimOverrideBitmask, + sizeof(unsigned int)); +#endif + DWORD skinId = app.getSkinIdFromPath(m_path); app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask); } break; default: