Merge branch 'MCLCE:main' into main

This commit is contained in:
JJminecraftguy 2026-04-20 16:58:41 -05:00 committed by GitHub
commit 748a07867a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 41 additions and 7 deletions

View file

@ -583,23 +583,26 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
{ {
U8 szSoundName[256]; U8 szSoundName[256];
wstring name; wstring name;
const char* soundDir;
if (iSound >= eSFX_MAX) if (iSound >= eSFX_MAX)
{ {
strcpy((char*)szSoundName, "Minecraft/"); strcpy((char*)szSoundName, "Minecraft/");
name = wchSoundNames[iSound]; name = wchSoundNames[iSound];
soundDir = "Minecraft";
} }
else else
{ {
strcpy((char*)szSoundName, "Minecraft/UI/"); strcpy((char*)szSoundName, "Minecraft/UI/");
name = wchUISoundNames[iSound]; name = wchUISoundNames[iSound];
soundDir = "Minecraft/UI";
} }
char* SoundName = (char*)ConvertSoundPathToName(name); char* SoundName = (char*)ConvertSoundPathToName(name);
strcat((char*)szSoundName, SoundName); strcat((char*)szSoundName, SoundName);
char basePath[256]; char basePath[256];
sprintf_s(basePath, "Windows64Media/Sound/Minecraft/UI/%s", ConvertSoundPathToName(name)); sprintf_s(basePath, "Windows64Media/Sound/%s/%s", soundDir, ConvertSoundPathToName(name));
char finalPath[256]; char finalPath[256];
sprintf_s(finalPath, "%s.wav", basePath); sprintf_s(finalPath, "%s.wav", basePath);

View file

@ -110,6 +110,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
m_bThumbnailGetFailed = false; m_bThumbnailGetFailed = false;
m_seed = 0; m_seed = 0;
m_bIsCorrupt = false; m_bIsCorrupt = false;
m_pbThumbnailData = nullptr;
m_uiThumbnailSize = 0;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
// 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it. // 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it.
@ -249,13 +251,32 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
#endif #endif
#endif #endif
#ifdef _WINDOWS64 #ifdef _WINDOWS64
if (params->saveDetails != nullptr && params->saveDetails->UTF8SaveName[0] != '\0') if (params->saveDetails != nullptr)
{ {
wchar_t wSaveName[128]; if (params->saveDetails->UTF8SaveName[0] != '\0')
ZeroMemory(wSaveName, sizeof(wSaveName)); {
mbstowcs(wSaveName, params->saveDetails->UTF8SaveName, 127); wchar_t wSaveName[128];
m_levelName = wstring(wSaveName); ZeroMemory(wSaveName, sizeof(wSaveName));
m_labelGameName.init(m_levelName); mbstowcs(wSaveName, params->saveDetails->UTF8SaveName, 127);
m_levelName = wstring(wSaveName);
m_labelGameName.init(m_levelName);
}
wchar_t wFilename[MAX_SAVEFILENAME_LENGTH];
ZeroMemory(wFilename, sizeof(wFilename));
mbstowcs(wFilename, params->saveDetails->UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
m_thumbnailName = wFilename;
if (params->saveDetails->pbThumbnailData && params->saveDetails->dwThumbnailSize > 0)
{
// save list already loaded this, register and display it
registerSubstitutionTexture(wFilename, params->saveDetails->pbThumbnailData, params->saveDetails->dwThumbnailSize);
m_bitmapIcon.setTextureName(wFilename);
m_pbThumbnailData = params->saveDetails->pbThumbnailData;
m_uiThumbnailSize = params->saveDetails->dwThumbnailSize;
}
m_bRetrievingSaveThumbnail = false;
} }
#endif #endif
} }

View file

@ -8,6 +8,9 @@
#include "Settings.h" #include "Settings.h"
#include "PlayerList.h" #include "PlayerList.h"
#include "MultiPlayerLevel.h" #include "MultiPlayerLevel.h"
#include "Minecraft.h"
#include "Common/Audio/SoundEngine.h"
#include "../Minecraft.World/SoundTypes.h"
#include "../Minecraft.World/net.minecraft.network.packet.h" #include "../Minecraft.World/net.minecraft.network.packet.h"
#include "../Minecraft.World/net.minecraft.world.damagesource.h" #include "../Minecraft.World/net.minecraft.world.damagesource.h"
@ -783,6 +786,13 @@ void ServerPlayer::changeDimension(int i)
// 4J: Removed on the advice of the mighty King of Achievments (JV) // 4J: Removed on the advice of the mighty King of Achievments (JV)
// awardStat(GenericStats::portal(), GenericStats::param_portal()); // awardStat(GenericStats::portal(), GenericStats::param_portal());
} }
// play the travel whoosh right before the actual dimension swap
Minecraft *mc = Minecraft::GetInstance();
if (mc != nullptr && mc->soundEngine != nullptr)
{
mc->soundEngine->playUI(eSoundType_PORTAL_TRAVEL, 1, 1.0f);
}
server->getPlayers()->toggleDimension( dynamic_pointer_cast<ServerPlayer>(shared_from_this()), i); server->getPlayers()->toggleDimension( dynamic_pointer_cast<ServerPlayer>(shared_from_this()), i);
lastSentExp = -1; lastSentExp = -1;
lastSentHealth = -1; lastSentHealth = -1;