diff --git a/BUMP b/BUMP index 910abdcc..3e153f5b 100644 --- a/BUMP +++ b/BUMP @@ -1 +1 @@ -1.1.0b +1.1.1b diff --git a/Minecraft.Client/CMakeLists.txt b/Minecraft.Client/CMakeLists.txt index bec4fef7..a5e22f1d 100644 --- a/Minecraft.Client/CMakeLists.txt +++ b/Minecraft.Client/CMakeLists.txt @@ -112,6 +112,34 @@ set(ASSET_FOLDER_PAIRS ) setup_asset_folder_copy(Minecraft.Client "${ASSET_FOLDER_PAIRS}") +if(PLATFORM_NAME STREQUAL "Windows64") + file(GLOB_RECURSE PANORAMA_XML_ASSETS CONFIGURE_DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}Media/**/panorama.xml" + ) + + if(PANORAMA_XML_ASSETS) + set(PANORAMA_XML_COPY_COMMANDS) + foreach(PANORAMA_XML_ASSET IN LISTS PANORAMA_XML_ASSETS) + file(RELATIVE_PATH PANORAMA_XML_REL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}Media" "${PANORAMA_XML_ASSET}") + get_filename_component(PANORAMA_XML_REL_DIR "${PANORAMA_XML_REL_PATH}" DIRECTORY) + list(APPEND PANORAMA_XML_COPY_COMMANDS + COMMAND ${CMAKE_COMMAND} -E make_directory "$/${PLATFORM_NAME}Media/${PANORAMA_XML_REL_DIR}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${PANORAMA_XML_ASSET}" + "$/${PLATFORM_NAME}Media/${PANORAMA_XML_REL_PATH}" + ) + endforeach() + + add_custom_target(AssetPanoramaXmlCopy_Minecraft.Client ALL + ${PANORAMA_XML_COPY_COMMANDS} + COMMENT "Copying panorama XML assets into build folder..." + VERBATIM + ) + add_dependencies(Minecraft.Client AssetPanoramaXmlCopy_Minecraft.Client) + set_property(TARGET AssetPanoramaXmlCopy_Minecraft.Client PROPERTY FOLDER "Build") + endif() +endif() + set(LOOT_TABLES_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Common/Media/MediaWindows64/Structures/loot_tables") set(LOOT_TABLES_DEST "$/Common/Media/MediaWindows64/Structures/loot_tables") add_custom_target(AssetLootTablesCopy_Minecraft.Client ALL diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 6717114c..8ef643a6 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -577,12 +577,14 @@ void ClientConnection::handleAddEntity(shared_ptr packet) { int dir = packet->data & 0xFF; bool placedByPlayer = (packet->data & 0x100) != 0; + bool placedByTutorial = (packet->data & 0x200) != 0; e = std::make_shared(level, (int)x, (int)y, (int)z, dir); shared_ptr frame = dynamic_pointer_cast(e); if (frame != nullptr) { frame->placedByPlayer = placedByPlayer; - if (placedByPlayer) + frame->placedByTutorial = placedByTutorial; + if (placedByPlayer || placedByTutorial) { frame->setDir(dir); } @@ -842,7 +844,8 @@ void ClientConnection::handleAddPainting(shared_ptr packet) { shared_ptr painting = std::make_shared(level, packet->x, packet->y, packet->z, packet->dir, packet->motive); painting->placedByPlayer = packet->placedByPlayer; - if (packet->placedByPlayer) + painting->placedByTutorial = packet->placedByTutorial; + if (packet->placedByPlayer || packet->placedByTutorial) { painting->setDir(packet->dir); } @@ -4180,14 +4183,16 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E } } -#if defined(_XBOX_ONE) || defined(__ORBIS__) + const int controlType = app.GetGameSettings(iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + // Give the player the option to save their game // does the save exist? bool bSaveExists; StorageManager.DoesSaveExist(&bSaveExists); // 4J-PB - we check if the save exists inside the libs // we need to ask if they are sure they want to overwrite the existing game - if(bSaveExists && StorageManager.GetSaveDisabled()) + if(bSaveExists && (!consoleAutosave || StorageManager.GetSaveDisabled())) { UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; @@ -4195,26 +4200,11 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E ui.RequestErrorMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,nullptr); } else -#else - // Give the player the option to save their game - // does the save exist? - bool bSaveExists; - StorageManager.DoesSaveExist(&bSaveExists); - // 4J-PB - we check if the save exists inside the libs - // we need to ask if they are sure they want to overwrite the existing game - if(bSaveExists) { - UINT uiIDA[2]; - uiIDA[0]=IDS_CONFIRM_CANCEL; - uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestErrorMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,nullptr); - } - else -#endif - { -#if defined(_XBOX_ONE) || defined(__ORBIS__) - StorageManager.SetSaveDisabled(false); -#endif + if(consoleAutosave) + { + StorageManager.SetSaveDisabled(false); + } MinecraftServer::getInstance()->setSaveOnExit( true ); // flag a app action of exit game app.SetAction(iPad,eAppAction_ExitWorld); diff --git a/Minecraft.Client/Common/App_Defines.h b/Minecraft.Client/Common/App_Defines.h index 28b02191..48c4ab79 100644 --- a/Minecraft.Client/Common/App_Defines.h +++ b/Minecraft.Client/Common/App_Defines.h @@ -100,6 +100,7 @@ enum EGameHostOptionWorldSize #define GAMESETTING_DISPLAYHAND 0x00000100 #define GAMESETTING_CUSTOMSKINANIM 0x00000200 #define GAMESETTING_DEATHMESSAGES 0x00000400 +#define GAMESETTING_PASSIVECHUNKLOADING 0x00040000 #define GAMESETTING_UISIZE 0x00001800 #define GAMESETTING_UISIZE_SPLITSCREEN 0x00006000 #define GAMESETTING_ANIMATEDCHARACTER 0x00008000 diff --git a/Minecraft.Client/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h index 50ff0da0..77a324a6 100644 --- a/Minecraft.Client/Common/App_enums.h +++ b/Minecraft.Client/Common/App_enums.h @@ -193,6 +193,9 @@ enum eGameSetting eGameSetting_SafeCam, //safe cam is safe sprint eGameSetting_Swap, eGameSetting_GameChat, + + // custom + eGameSetting_PassiveChunkLoading, }; diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index f24a760d..031d3906 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -82,6 +82,7 @@ void SoundEngine::stopStreamingNow() m_StreamState = eMusicStreamState_Idle; m_musicID = -1; m_iMusicDelay = 0; + m_bCurrentStreamIsMenuMusic = false; } #ifdef _WINDOWS64 @@ -470,6 +471,9 @@ SoundEngine::SoundEngine() m_musicFadeSecondsRemaining = 0.0f; m_musicFadeLastUpdateTime = std::chrono::steady_clock::now(); m_bCurrentStreamIsCustom = false; + m_bCurrentStreamIsMenuMusic = true; + m_bPendingCustomMusicFade = false; + m_bPendingMenuMusicStart = false; memset(CurrentSoundsPlaying,0,sizeof(int)*(eSoundType_MAX+eSFX_MAX)); memset(m_ListenerA,0,sizeof(AUDIO_LISTENER)*XUSER_MAX_COUNT); @@ -847,10 +851,40 @@ void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, m_StreamingAudioInfo.volume = volume; m_StreamingAudioInfo.pitch = pitch; - bool bNextCustom = isCustomMusicRequest(name); - bool bCurrentCustom = m_musicStreamActive && m_bCurrentStreamIsCustom; + if (name.empty() && m_musicStreamActive && isPlayingMenuMusic() && !isCustomMusicRequest(name)) + { + return; + } - if(m_StreamState == eMusicStreamState_Playing) + if (name.empty() && m_bPendingMenuMusicStart && + (m_StreamState == eMusicStreamState_Playing || m_StreamState == eMusicStreamState_Fading)) + { + return; + } + + const bool bNextCustom = isCustomMusicRequest(name); + const bool bCurrentCustom = m_musicStreamActive && m_bCurrentStreamIsCustom; + const bool bTransitioningFromCustomMusic = name.empty() && m_musicStreamActive && bCurrentCustom && !m_bCurrentStreamIsMenuMusic; + const bool bTransitioningFromNonMenuMusic = name.empty() && m_musicStreamActive && !m_bCurrentStreamIsMenuMusic; + + if (bTransitioningFromNonMenuMusic && (m_StreamState == eMusicStreamState_Playing || m_StreamState == eMusicStreamState_Fading)) + { + m_bPendingMenuMusicStart = true; + m_bCurrentStreamIsMenuMusic = false; + if (bTransitioningFromCustomMusic) + { + m_bPendingCustomMusicFade = true; + } + if (m_StreamState == eMusicStreamState_Playing) + { + m_StreamState = eMusicStreamState_Fading; + m_musicFadeSecondsRemaining = MUSIC_FADE_DURATION_SECONDS; + m_musicFadeLastUpdateTime = std::chrono::steady_clock::now(); + } + return; + } + + if (m_StreamState == eMusicStreamState_Playing) { if (bCurrentCustom != bNextCustom) { @@ -868,6 +902,7 @@ void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, { // music, or stop CD m_StreamingAudioInfo.bIs3D = false; + m_bCurrentStreamIsMenuMusic = false; // random delay of up to 3 minutes for music m_iMusicDelay = random->nextInt(20 * 60 * 3); @@ -921,6 +956,7 @@ void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, { // jukebox m_StreamingAudioInfo.bIs3D=true; + m_bCurrentStreamIsMenuMusic = false; m_musicID = getMusicID(name); m_iMusicDelay = 0; @@ -933,6 +969,11 @@ void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, } } +bool SoundEngine::isPlayingMenuMusic() const +{ + return m_musicStreamActive && m_bCurrentStreamIsMenuMusic; +} + bool SoundEngine::isCustomMusicRequest(const wstring& name) const { if (!name.empty()) @@ -1520,7 +1561,15 @@ void SoundEngine::playMusicUpdate() SetIsPlayingStreamingCDMusic(false); SetIsPlayingStreamingGameMusic(false); + if (m_bPendingMenuMusicStart) + { + m_musicID = getMusicID(eMusicType_Menu); + m_bCurrentStreamIsMenuMusic = true; + m_iMusicDelay = 0; + m_bPendingMenuMusicStart = false; + } m_StreamState = eMusicStreamState_Idle; + m_bPendingCustomMusicFade = false; break; case eMusicStreamState_Stopping: break; diff --git a/Minecraft.Client/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Audio/SoundEngine.h index 3fe3f9dd..10bf745a 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.h +++ b/Minecraft.Client/Common/Audio/SoundEngine.h @@ -136,6 +136,7 @@ public: void stopElytraSound(); void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) override; void stopStreamingNow(); + bool isPlayingMenuMusic() const; void playUI(int iSound, float volume, float pitch) override; void playMusicTick() override; void updateMusicVolume(float fVal) override; @@ -173,6 +174,9 @@ private: float m_musicFadeSecondsRemaining; std::chrono::steady_clock::time_point m_musicFadeLastUpdateTime; bool m_bCurrentStreamIsCustom; + bool m_bCurrentStreamIsMenuMusic; + bool m_bPendingCustomMusicFade; + bool m_bPendingMenuMusicStart; ma_engine m_engine; ma_engine_config m_engineConfig; diff --git a/Minecraft.Client/Common/Audio/SoundNames.cpp b/Minecraft.Client/Common/Audio/SoundNames.cpp index afc3343c..b142e85d 100644 --- a/Minecraft.Client/Common/Audio/SoundNames.cpp +++ b/Minecraft.Client/Common/Audio/SoundNames.cpp @@ -294,9 +294,48 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= L"mob.polarbear.hurt", L"mob.polarbear.death", L"mob.polarbear.step", - L"mob.polarbear.warning" + L"mob.polarbear.warning", + // tu43 + // witch sounds + L"entity.witch.ambient", //eSoundType_ENTITY_WITCH_AMBIENT, + L"entity.witch.hurt", //eSoundType_ENTITY_WITCH_HURT, + L"entity.witch.death", //eSoundType_ENTITY_WITCH_DEATH, + L"entity.witch.throw", //eSoundType_ENTITY_WITCH_THROW, + // squid sounds + L"entity.squid.ambient", //eSoundType_ENTITY_SQUID_AMBIENT, + L"entity.squid.hurt", //eSoundType_ENTITY_SQUID_HURT, + L"entity.squid.death", //eSoundType_ENTITY_SQUID_DEATH, + + // snowman sounds + L"entity.snowman.hurt", //eSoundType_ENTITY_SNOWMAN_HURT, + L"entity.snowman.death", //eSoundType_ENTITY_SNOWMAN_DEATH, + + // armor stand sounds + L"entity.armorstand.break", //eSoundType_ENTITY_ARMORSTAND_BREAK, + L"entity.armorstand.hit", //eSoundType_ENTITY_ARMORSTAND_HIT, + + // cow sounds + L"entity.cow.milk", //eSoundType_ENTITY_COW_MILK, + + // horse sounds + L"entity.horse.eat", // eSoundType_ENTITY_EAT, + + // item frame sounds + L"entity.itemframe.add_item", //eSoundType_ENTITY_ITEMFRAME_ADD_ITEM, + L"entity.itemframe.break", //eSoundType_ENTITY_ITEMFRAME_BREAK, + L"entity.itemframe.place", //eSoundType_ENTITY_ITEMFRAME_PLACE, + L"entity.itemframe.remove_item", //eSoundType_ENTITY_ITEMFRAME_REMOVE_ITEM, + L"entity.itemframe.rotate_item", //eSoundType_ENTITY_ITEMFRAME_ROTATE_ITEM, + + // leash sounds + L"entity.leashknot.break", //eSoundType_ENTITY_LEASHKNOT_BREAK, + L"entity.leashknot.place", //eSoundType_ENTITY_LEASHKNOT_PLACE, + + // painting sounds + L"entity.painting.place", //eSoundType_ENTITY_PAINTING_PLACE, + L"entity.painting.break", //eSoundType_ENTITY_PAINTING_BREAK, }; diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index c77746fa..40310d75 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1051,6 +1051,9 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con //TU34 SetGameSettings(iPad, eGameSetting_MinecartSounds, 1); + // custom + SetGameSettings(iPad, eGameSetting_PassiveChunkLoading, 0); + // 4J-PB - leave these in, or remove from everywhere they are referenced! // Although probably best to leave in unless we split the profile settings into platform specific classes - having different meaning per platform for the same bitmask could get confusing //#ifdef __PS3__ @@ -1516,6 +1519,9 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad) ActionGameSettings(iPad, eGameSetting_HideSaveSizeBar); ActionGameSettings(iPad, eGameSetting_SafeCam); ActionGameSettings(iPad, eGameSetting_Swap); + + // custom + ActionGameSettings(iPad, eGameSetting_PassiveChunkLoading); } void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) @@ -1735,6 +1741,9 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) case eGameSetting_DeathMessages: //nothing to do here break; + case eGameSetting_PassiveChunkLoading: + //nothing to do here + break; case eGameSetting_UISize: //nothing to do here break; @@ -2449,6 +2458,21 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV GameSettingsA[iPad]->bSettingsChanged=true; } break; + case eGameSetting_PassiveChunkLoading: + if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_PASSIVECHUNKLOADING)!=(ucVal&0x01)<<18) + { + if(ucVal==1) + { + GameSettingsA[iPad]->uiBitmaskValues|=GAMESETTING_PASSIVECHUNKLOADING; + } + else + { + GameSettingsA[iPad]->uiBitmaskValues&=~GAMESETTING_PASSIVECHUNKLOADING; + } + ActionGameSettings(iPad,eVal); + GameSettingsA[iPad]->bSettingsChanged=true; + } + break; case eGameSetting_UISize: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_UISIZE)!=((ucVal&0x03)<<11)) { @@ -2759,6 +2783,9 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) case eGameSetting_DeathMessages: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_DEATHMESSAGES)>>10; break; + case eGameSetting_PassiveChunkLoading: + return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_PASSIVECHUNKLOADING)>>18; + break; case eGameSetting_UISize: { unsigned char ucVal=(GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_UISIZE)>>11; @@ -3253,11 +3280,17 @@ void CMinecraftApp::HandleXuiActions(void) app.SetAutosaveTimerTime(); SetAction(i,eAppAction_Idle); -#if defined(_XBOX_ONE) || defined(__ORBIS__) - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame); + const int controlType = app.GetGameSettings(ProfileManager.GetPrimaryPad(), eGameSetting_ControlType); + const bool useAutosaveAnimation = (controlType == 0 || controlType == 1 || controlType == 4); - if(app.GetGameHostOption(eGameHostOption_DisableSaving)) StorageManager.SetSaveDisabled(true); -#else + if (useAutosaveAnimation) + { + new C4JThread(&UIScene_PauseMenu::SaveWorldThreadProc, (void*)true, "AutosaveSaveThread"); + if(app.GetGameHostOption(eGameHostOption_DisableSaving)) StorageManager.SetSaveDisabled(true); + ui.ShowSavingMessage(ProfileManager.GetPrimaryPad(), C4JStorage::ESavingMessage_Short); + } + else + { // turn off the gamertags in splitscreen for the primary player, since they are about to be made fullscreen ui.HideAllGameUIElements(); @@ -3293,7 +3326,7 @@ void CMinecraftApp::HandleXuiActions(void) #endif ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams , eUILayer_Fullscreen, eUIGroup_Fullscreen); -#endif + } } break; case eAppAction_ExitPlayer: @@ -6398,7 +6431,6 @@ int CMinecraftApp::ExitAndJoinFromInvite(void *pParam,int iPad,C4JStorage::EMess return 0; } - int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { CMinecraftApp *pClass = static_cast(pParam); @@ -6439,26 +6471,33 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad return S_OK; } } -#ifndef _XBOX_ONE - // does the save exist? - bool bSaveExists; - StorageManager.DoesSaveExist(&bSaveExists); - // 4J-PB - we check if the save exists inside the libs - // we need to ask if they are sure they want to overwrite the existing game - if(bSaveExists) + + const int controlType = app.GetGameSettings(iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); + + #ifndef _XBOX_ONE { - UINT uiIDA[2]; - uiIDA[0]=IDS_CONFIRM_CANCEL; - uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestErrorMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned,pClass); - return 0; + // does the save exist? + bool bSaveExists; + StorageManager.DoesSaveExist(&bSaveExists); + // 4J-PB - we check if the save exists inside the libs + // we need to ask if they are sure they want to overwrite the existing game + if(bSaveExists) + { + UINT uiIDA[2]; + uiIDA[0]=IDS_CONFIRM_CANCEL; + uiIDA[1]=IDS_CONFIRM_OK; + ui.RequestErrorMessage(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned,pClass); + return 0; + } } - else -#endif + #endif + { -#if defined(_XBOX_ONE) || defined(__ORBIS__) - StorageManager.SetSaveDisabled(false); -#endif + if(consoleAutosave) + { + StorageManager.SetSaveDisabled(false); + } MinecraftServer::getInstance()->setSaveOnExit( true ); } } @@ -7985,14 +8024,18 @@ void CMinecraftApp::EnterSaveNotificationSection() { if(g_NetworkManager.IsInSession()) // this can be triggered from the front end if we're downloading a save { - MinecraftServer::getInstance()->broadcastStartSavingPacket(); + MinecraftServer::getInstance()->broadcastStartSavingPacket(); - if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) - { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE); + const int controlType = app.GetGameSettings(ProfileManager.GetPrimaryPad(), eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); + const bool isAutosaveAction = (app.GetXuiServerAction(ProfileManager.GetPrimaryPad()) == eXuiServerAction_AutoSaveGame); + const bool shouldPauseServer = g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 && !(consoleAutosave && isAutosaveAction); + if(shouldPauseServer) + { + app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE); + } } } - } LeaveCriticalSection(&m_saveNotificationCriticalSection); } @@ -8003,14 +8046,18 @@ void CMinecraftApp::LeaveSaveNotificationSection() { if(g_NetworkManager.IsInSession()) // this can be triggered from the front end if we're downloading a save { - MinecraftServer::getInstance()->broadcastStopSavingPacket(); + MinecraftServer::getInstance()->broadcastStopSavingPacket(); - if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) - { - app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + const int controlType = app.GetGameSettings(ProfileManager.GetPrimaryPad(), eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); + const bool isAutosaveAction = (app.GetXuiServerAction(ProfileManager.GetPrimaryPad()) == eXuiServerAction_AutoSaveGame); + const bool shouldPauseServer = g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 && !(consoleAutosave && isAutosaveAction); + if(shouldPauseServer) + { + app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); + } } } - } LeaveCriticalSection(&m_saveNotificationCriticalSection); } @@ -8057,6 +8104,14 @@ int CMinecraftApp::RemoteSaveThreadProc( void* lpParameter ) return S_OK; } +UINT CMinecraftApp::GetCorrectExitKey(int iPad) +{ + const int controlType = GetGameSettings(iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); + + return consoleAutosave ? IDS_CONFIRM_EXIT_GAME_AUTOSAVE : IDS_CONFIRM_EXIT_GAME; +} + void CMinecraftApp::ExitGameFromRemoteSave( LPVOID lpParameter ) { int primaryPad = ProfileManager.GetPrimaryPad(); @@ -8065,7 +8120,7 @@ void CMinecraftApp::ExitGameFromRemoteSave( LPVOID lpParameter ) uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, primaryPad,&CMinecraftApp::ExitGameFromRemoteSaveDialogReturned,nullptr); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(primaryPad), uiIDA, 2, primaryPad,&CMinecraftApp::ExitGameFromRemoteSaveDialogReturned,nullptr); } int CMinecraftApp::ExitGameFromRemoteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) @@ -10184,11 +10239,13 @@ int CMinecraftApp::GetDLCInfoTexturesOffersCount() // AUTOSAVE void CMinecraftApp::SetAutosaveTimerTime(void) { -#if defined(_XBOX_ONE) || defined(__ORBIS__) - m_uiAutosaveTimer= GetTickCount()+1000*60; -#else - m_uiAutosaveTimer= GetTickCount()+GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_Autosave)*1000*60*15; -#endif + int primaryPad = ProfileManager.GetPrimaryPad(); + const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType); + const bool fasterAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + if (fasterAutosave) + m_uiAutosaveTimer= GetTickCount() + GetGameSettings(primaryPad, eGameSetting_Autosave) * 1000 * 60; + else + m_uiAutosaveTimer= GetTickCount() + GetGameSettings(primaryPad, eGameSetting_Autosave) * 1000 * 60 * 15; }// value x 15 to get mins, x60 for secs bool CMinecraftApp::AutosaveDue(void) diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index 76ed2579..840a882b 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -675,6 +675,8 @@ public: // 4J Stu - Now storing the whole XUSER_SIGNIN_INFO so we can detect xuid changes XUSER_SIGNIN_INFO m_currentSigninInfo[XUSER_MAX_COUNT]; + UINT GetCorrectExitKey(int iPad); + //void OverrideFontRenderer(bool set, bool immediate = true); // void ToggleFontRenderer() { OverrideFontRenderer(!m_bFontRendererOverridden,false); } BANNEDLIST BannedListA[XUSER_MAX_COUNT]; diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf new file mode 100644 index 00000000..f720dc6f Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/windowsHD.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOne.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOne.swf deleted file mode 100644 index 464cb346..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/HD/xboxOne.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf new file mode 100644 index 00000000..691d0cec Binary files /dev/null and b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu1080.swf deleted file mode 100644 index 7e731522..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu720.swf deleted file mode 100644 index 7e731522..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenu720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenuSplit1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenuSplit1080.swf deleted file mode 100644 index 99d2251b..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenuSplit1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenuSplit720.swf deleted file mode 100644 index 99d2251b..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsAudioMenuSplit720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu1080.swf deleted file mode 100644 index 39fc0dd4..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu720.swf deleted file mode 100644 index 39fc0dd4..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenu720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenuSplit1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenuSplit1080.swf deleted file mode 100644 index 0b3713ae..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenuSplit1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenuSplit720.swf deleted file mode 100644 index 0b3713ae..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsGraphicsMenuSplit720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenu1080.swf deleted file mode 100644 index dfefaf46..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenu1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenu720.swf deleted file mode 100644 index dfefaf46..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenu720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenuSplit1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenuSplit1080.swf deleted file mode 100644 index cfceefcf..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenuSplit1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenuSplit720.swf deleted file mode 100644 index cfceefcf..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsOptionsMenuSplit720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu1080.swf deleted file mode 100644 index 78b8aa2c..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu720.swf deleted file mode 100644 index 78b8aa2c..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenu720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenuSplit1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenuSplit1080.swf deleted file mode 100644 index 055f36e8..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenuSplit1080.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenuSplit720.swf deleted file mode 100644 index 055f36e8..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/SettingsUIMenuSplit720.swf and /dev/null differ diff --git a/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp index fa10afc4..823bc895 100644 --- a/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_PauseMenu.cpp @@ -27,6 +27,19 @@ int IUIScene_PauseMenu::ExitGameDialogReturned(void *pParam,int iPad,C4JStorage: // Results switched for this dialog if(result==C4JStorage::EMessage_ResultDecline) { + const int controlType = app.GetGameSettings(iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + const bool autosaveEnabled = consoleAutosave && !StorageManager.GetSaveDisabled() && (app.GetGameHostOption(eGameHostOption_DisableSaving) == 0); + + if(autosaveEnabled) + { + MinecraftServer::getInstance()->setSaveOnExit(true); + } + else + { + MinecraftServer::getInstance()->setSaveOnExit(false); + } + if(pScene) pScene->SetIgnoreInput(true); app.SetAction(iPad,eAppAction_ExitWorld); } @@ -159,7 +172,7 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage } else { - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, ProfileManager.GetPrimaryPad(), &IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(ProfileManager.GetPrimaryPad()), uiIDA, 3, ProfileManager.GetPrimaryPad(), &IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam); } } } @@ -205,7 +218,7 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(void *pParam,int iPad,C4JSto } else { - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(ProfileManager.GetPrimaryPad()), uiIDA, 3, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameSaveDialogReturned, pParam); } } @@ -373,14 +386,17 @@ int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) if(ProfileManager.IsFullVersion()) { - app.SetGameStarted(false); + if(!bAutosave) + { + app.SetGameStarted(false); + } while( app.GetXuiServerAction(ProfileManager.GetPrimaryPad() ) != eXuiServerAction_Idle && !MinecraftServer::serverHalted() ) { Sleep(10); } - if(!MinecraftServer::serverHalted() && !app.GetChangingSessionType() ) app.SetGameStarted(true); + if(!bAutosave && !MinecraftServer::serverHalted() && !app.GetChangingSessionType() ) app.SetGameStarted(true); #if defined(_XBOX_ONE) || defined(__ORBIS__) if(app.GetGameHostOption(eGameHostOption_DisableSaving)) StorageManager.SetSaveDisabled(true); @@ -734,15 +750,19 @@ int IUIScene_PauseMenu::SaveGameDialogReturned(void *pParam,int iPad,C4JStorage: // results switched for this dialog if(result==C4JStorage::EMessage_ResultDecline) { -#if defined(_XBOX_ONE) || defined(__ORBIS__) - UINT uiIDA[2]; - uiIDA[0]=IDS_CONFIRM_CANCEL; - uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,pParam); -#else - // flag a app action of save game - app.SetAction(iPad,eAppAction_SaveGame); -#endif + const int controlType = app.GetGameSettings(iPad, eGameSetting_ControlType); + if (controlType == 0 || controlType == 1 || controlType == 4) // windows, xbox one, and ps4 + { + UINT uiIDA[2]; + uiIDA[0]=IDS_CONFIRM_CANCEL; + uiIDA[1]=IDS_CONFIRM_OK; + ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,pParam); + } + else + { + // flag a app action of save game + app.SetAction(iPad,eAppAction_SaveGame); + } } return 0; } diff --git a/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp b/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp index 8b0f8d09..1aa5b77a 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp @@ -6,6 +6,8 @@ #include "../../../Minecraft.World/net.minecraft.world.level.dimension.h" #include "../../../Minecraft.World/net.minecraft.world.level.storage.h" #include "Tesselator.h" +#include "TexturePackRepository.h" +#include "TexturePack.h" #include "Textures.h" #include "BufferedImage.h" #include "../GameRules/LevelGenerationOptions.h" @@ -197,6 +199,8 @@ static wstring GetPanoramaTexturePath() const char *mountedPanoramaRoots[] = { + "TPACK:/Data/ControlType/Panorama/", + "WPACK:/Data/ControlType/Panorama/", "TPACK:Data/ControlType/Panorama/", "WPACK:Data/ControlType/Panorama/", }; @@ -206,6 +210,16 @@ static wstring GetPanoramaTexturePath() wstring mountedPath = convStringToWstring(StorageManager.GetMountedPath(mountedRoot)); if(mountedPath.empty()) continue; + if(mountedPath.find(L"Data/ControlType/Panorama/") != wstring::npos) + { + // slash check cause for some reason its not always there + size_t pos = mountedPath.find(L"Data/ControlType/Panorama/"); + if(pos != wstring::npos && pos > 0 && mountedPath[pos-1] != L'/' && mountedPath[pos-1] != L'\\') + { + mountedPath.insert(pos, 1, L'/'); + } + } + wstring sampleDay = mountedPath + L"Panorama_S.png"; wstring sampleNight = mountedPath + L"Panorama_N.png"; if(GetFileAttributesW(sampleDay.c_str()) != INVALID_FILE_ATTRIBUTES || @@ -229,6 +243,25 @@ static wstring GetPanoramaTexturePath() return PANORAMA_TEXTURE_RELPATH; } +static wstring GetPanoramaTexturePathKey() +{ + wstring key = GetPanoramaTexturePath(); + + Minecraft *pMinecraft = Minecraft::GetInstance(); + if(pMinecraft != nullptr && pMinecraft->skins != nullptr) + { + TexturePack *selected = pMinecraft->skins->getSelected(); + if(selected != nullptr) + { + wchar_t buffer[32]; + swprintf(buffer, 32, L"|TPACKID=%u", static_cast(selected->getId())); + key += buffer; + } + } + + return key; +} + // opengl time :v static int LoadPanoramaQuadTexture(const wstring &fileName, float blurSigma, int &outWidth, int &outHeight) { @@ -478,7 +511,8 @@ void UIComponent_Panorama::tick() void UIComponent_Panorama::EnsurePanoramaTexturesLoaded() { wstring currentRoot = GetPanoramaTexturePath(); - if(m_bPanoramaTexturesLoaded && currentRoot == m_panoramaTextureRoot) return; + wstring currentRootKey = GetPanoramaTexturePathKey(); + if(m_bPanoramaTexturesLoaded && currentRoot == m_panoramaTextureRoot && currentRootKey == m_panoramaTextureRootKey) return; if(m_texPanoramaDay >= 0) { @@ -492,6 +526,7 @@ void UIComponent_Panorama::EnsurePanoramaTexturesLoaded() } m_panoramaTextureRoot = currentRoot; + m_panoramaTextureRootKey = currentRootKey; m_bPanoramaTexturesLoaded = false; // search for panorama.xml diff --git a/Minecraft.Client/Common/UI/UIComponent_Panorama.h b/Minecraft.Client/Common/UI/UIComponent_Panorama.h index d5465694..d40a528b 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Panorama.h +++ b/Minecraft.Client/Common/UI/UIComponent_Panorama.h @@ -15,6 +15,7 @@ private: bool m_bPanoramaTexturesLoaded = false; wstring m_panoramaTextureRoot; + wstring m_panoramaTextureRootKey; float m_panoramaAspect = 1.0f; DWORD m_lastScrollTickMs = 0; float m_panoramaScroll = 0.0f; diff --git a/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp b/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp index 9580789f..580ca81f 100644 --- a/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp @@ -11,6 +11,7 @@ UIComponent_PressStartToPlay::UIComponent_PressStartToPlay(int iPad, void *initD m_showingSaveIcon = false; m_showingAutosaveTimer = false; m_showingTrialTimer = false; + m_saveIconPositionAdjusted = false; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { m_showingPressStart[i] = false; @@ -43,6 +44,12 @@ wstring UIComponent_PressStartToPlay::getMoviePath() void UIComponent_PressStartToPlay::handleReload() { // 4J Stu - It's possible these could change during the reload, so can't use the normal controls refresh of it's state + if(!m_saveIconPositionAdjusted) + { + m_controlSaveIcon.setXPos(m_controlSaveIcon.getXPos() + 40); + m_controlSaveIcon.setYPos(m_controlSaveIcon.getYPos() - 70); + m_saveIconPositionAdjusted = true; + } m_controlSaveIcon.setVisible(m_showingSaveIcon); m_labelTrialTimer.setVisible(m_showingAutosaveTimer); m_labelTrialTimer.setLabel(m_autosaveTimer); @@ -126,6 +133,13 @@ void UIComponent_PressStartToPlay::handleTimerComplete(int id) ui.toastOn = false; } } + + if (id == 2) + { + showSaveIcon(false); + killTimer(id); + } + ui.ClearPressStart(); } @@ -197,6 +211,16 @@ void UIComponent_PressStartToPlay::showSaveIcon(bool show) { if(show) app.DebugPrintf("Tried to show save icon while texture pack reload was in progress\n"); } + + if(show) + { + killTimer(2); + addTimer(2, 1000); + } + else + { + killTimer(2); + } } void UIComponent_PressStartToPlay::showPlayerDisplayName(bool show) diff --git a/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.h b/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.h index 26a77cd7..aae30896 100644 --- a/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.h +++ b/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.h @@ -8,6 +8,7 @@ private: bool m_showingSaveIcon; bool m_showingAutosaveTimer; bool m_showingTrialTimer; + bool m_saveIconPositionAdjusted; bool m_showingPressStart[XUSER_MAX_COUNT]; wstring m_trialTimer; wstring m_autosaveTimer; diff --git a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp index 18852873..28e0cc0c 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp @@ -142,8 +142,8 @@ void UIComponent_Tooltips::updateSafeZone() const F64 screenW = ui.getScreenWidth(); const F64 screenH = ui.getScreenHeight(); const bool largerThan720Window = (screenH > 720.0f) || (screenW > 1280.0f); - const bool menuContext = ui.GetMenuDisplayed(m_iPad); - if(getSceneResolution() == eSceneResolution_720 && largerThan720Window && menuContext) + // const bool menuContext = ui.GetMenuDisplayed(m_iPad); + if(getSceneResolution() == eSceneResolution_720 && largerThan720Window /*&& menuContext*/) { const F64 widthScale = screenW / 1920.0f; const F64 heightScale = screenH / 1080.0f; diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index f438c73d..49e92464 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -222,23 +222,12 @@ static wstring GetControlTypeSkinPath(int controlType, bool hd) break; } - if(skinName == L"windows") { - if (hd) - { - return L"skinHDWin.swf"; - } - - return L"skinWin.swf"; - } - else + if(hd) { - if(hd) - { - return wstring(L"Graphics\\ControlType\\HD\\") + skinName + L"HD.swf"; - } - - return wstring(L"Graphics\\ControlType\\") + skinName + L".swf"; + return wstring(L"Graphics\\ControlType\\HD\\") + skinName + L"HD.swf"; } + + return wstring(L"Graphics\\ControlType\\") + skinName + L".swf"; } #endif @@ -3161,11 +3150,15 @@ void UIController::ShowAutosaveCountdownTimer(bool show) void UIController::UpdateAutosaveCountdownTimer(unsigned int uiSeconds) { -#if !(defined(_XBOX_ONE) || defined(__ORBIS__)) - WCHAR wcAutosaveCountdown[100]; - swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds); - if(m_groups[static_cast(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast(eUIGroup_Fullscreen)]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown); -#endif + const int primaryPad = ProfileManager.GetPrimaryPad(); + const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); + if (!consoleAutosave) + { + WCHAR wcAutosaveCountdown[100]; + swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds); + if(m_groups[static_cast(eUIGroup_Fullscreen)]->getPressStartToPlay()) m_groups[static_cast(eUIGroup_Fullscreen)]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown); + } } void UIController::ShowSavingMessage(unsigned int iPad, C4JStorage::ESavingMessage eVal) diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 953d0366..978d3a82 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -18,16 +18,10 @@ bool UIScene::SceneShouldUse1080p(const std::wstring &moviePath) if(primaryPad < 0 || primaryPad >= XUSER_MAX_COUNT) primaryPad = 0; const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType); + const bool force1080ForControlType = (controlType == 0); const bool force720ForControlType = (controlType == 3 || controlType == 5); const bool isTutorialPopupMovie = (moviePath.find(L"TutorialPopup") == 0); - // dont refresh gui elements when the player - // is in the settings menu [resolution mismatch creates artifacts] - if(moviePath.find(L"SettingsUIMenu") == 0) - { - return (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie); - } - Minecraft *pMinecraft = Minecraft::GetInstance(); TexturePack *selectedPack = nullptr; if(pMinecraft && pMinecraft->skins) @@ -35,7 +29,15 @@ bool UIScene::SceneShouldUse1080p(const std::wstring &moviePath) selectedPack = pMinecraft->skins->getSelected(); } const bool isMarioWorld = (selectedPack && selectedPack->getId() == 1034); - return !isMarioWorld && (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie); + + // dont refresh gui elements when the player + // is in the settings menu [resolution mismatch creates artifacts] + if(moviePath.find(L"SettingsUIMenu") == 0) + { + return !isMarioWorld && (force1080ForControlType || ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie); + } + + return !isMarioWorld && (force1080ForControlType || ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie); #else (void)moviePath; return true; diff --git a/Minecraft.Client/Common/UI/UIScene_ControlsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_ControlsMenu.cpp index 0beff3d2..2c53d2b3 100644 --- a/Minecraft.Client/Common/UI/UIScene_ControlsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_ControlsMenu.cpp @@ -52,15 +52,26 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa m_buttonLayouts[0].init(L"1", eControl_Button0); m_buttonLayouts[1].init(L"2", eControl_Button1); m_buttonLayouts[2].init(L"3", eControl_Button2); + + if (controlType == 0) + { + m_buttonLayouts[1].setEnable(false); + m_buttonLayouts[2].setEnable(false); + } } #endif m_checkboxInvert.init(app.GetString(IDS_INVERT_LOOK), eControl_InvertLook, app.GetGameSettings(m_iPad,eGameSetting_ControlInvertLook)); m_checkboxSouthpaw.init(app.GetString(IDS_SOUTHPAW), eControl_Southpaw, app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw)); m_checkboxSafeCam.init(app.GetString(IDS_SAFE_SPRINT), eControl_SafeCam, app.GetGameSettings(m_iPad,eGameSetting_SafeCam)); - m_checkboxAbswap.init(app.GetString(IDS_SWAP), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap)); + if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0) { + m_checkboxAbswap.init(app.GetString(IDS_SWAP_KBM), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap)); + } + else + { + m_checkboxAbswap.init(app.GetString(IDS_SWAP), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap)); IggyDataValue result; IggyDataValue value[1]; value[0].type = IGGY_DATATYPE_boolean; @@ -73,6 +84,11 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa m_iSchemeTextA[2]=IDS_CONTROLS_SCHEME2; int iSelected=app.GetGameSettings(m_iPad,eGameSetting_ControlScheme); + if (controlType == 0) + { + app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,0); + iSelected = 0; + } #ifndef __PSVITA__ LPWSTR layoutString = new wchar_t[ 128 ]; @@ -211,6 +227,14 @@ void UIScene_ControlsMenu::handleCheckboxToggled(F64 controlId, bool selected) void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId) { int control = static_cast(controlId); + if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0 && control != eControl_Button0) + { + app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,0); + m_iCurrentNavigatedControlsLayout = 0; + m_bLayoutChanged = true; + return; + } + switch(control) { case eControl_Button0: @@ -233,6 +257,13 @@ void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId) void UIScene_ControlsMenu::handleFocusChange(F64 controlId, F64 childId) { int control = static_cast(controlId); + if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0 && control != eControl_Button0) + { + m_iCurrentNavigatedControlsLayout = 0; + m_bLayoutChanged = true; + return; + } + switch(control) { case eControl_Button0: @@ -246,6 +277,10 @@ void UIScene_ControlsMenu::handleFocusChange(F64 controlId, F64 childId) void UIScene_ControlsMenu::PositionAllText(int iPad) { + // disable for keyboard + int controlType = app.GetGameSettings(m_iPad,eGameSetting_ControlType); + if (controlType == 0) return; + IggyDataValue result; IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcClearAllKeyLines, 0, 0); diff --git a/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp b/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp index 6384f7d5..1613078f 100644 --- a/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp @@ -148,23 +148,28 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) break; } -#if defined (_XBOX_ONE) || defined(__ORBIS__) + + const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + + if (consoleAutosave) + { if(g_NetworkManager.IsHost() && StorageManager.GetSaveDisabled()) { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; uiIDA[2]=IDS_EXIT_GAME_NO_SAVE; - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId()); } else { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId()); } - -#else + } + else { if(StorageManager.GetSaveDisabled()) { uiIDA[0]=IDS_CONFIRM_CANCEL; @@ -179,17 +184,17 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) uiIDA[1]=IDS_EXIT_GAME_SAVE; uiIDA[2]=IDS_EXIT_GAME_NO_SAVE; - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&IUIScene_PauseMenu::ExitGameSaveDialogReturned,(LPVOID)GetCallbackUniqueId()); } else { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,(LPVOID)GetCallbackUniqueId()); } } -#endif + } } else { diff --git a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp index cf137320..34d6f407 100644 --- a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp @@ -28,6 +28,9 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa // Setup all the Iggy references we need for this scene initialiseMovie(); m_bIgnoreInput=false; + m_savesDisabled=false; + m_bTrialTexturePack=false; + m_bErrorDialogRunning=false; m_eAction=eAction_None; m_buttons[BUTTON_PAUSE_RESUMEGAME].init(app.GetString(IDS_RESUME_GAME),BUTTON_PAUSE_RESUMEGAME); @@ -52,27 +55,36 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa m_bTrialTexturePack = true; } } - - // 4J-TomK - check for all possible labels being fed into BUTTON_PAUSE_SAVEGAME (Bug 163775) - // this has to be done before button initialisation! - wchar_t saveButtonLabels[2][256]; - swprintf( saveButtonLabels[0], 256, L"%ls", app.GetString( IDS_SAVE_GAME )); - swprintf( saveButtonLabels[1], 256, L"%ls", app.GetString( IDS_DISABLE_AUTOSAVE )); - m_buttons[BUTTON_PAUSE_SAVEGAME].setAllPossibleLabels(2,saveButtonLabels); - - if(app.GetGameHostOption(eGameHostOption_DisableSaving) || m_bTrialTexturePack) - { - m_savesDisabled = true; - m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME); - } - else - { - m_savesDisabled = false; - m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_DISABLE_AUTOSAVE),BUTTON_PAUSE_SAVEGAME); - } -#else - m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME); #endif + + const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + + if (consoleAutosave) + { + // 4J-TomK - check for all possible labels being fed into BUTTON_PAUSE_SAVEGAME (Bug 163775) + // this has to be done before button initialisation! + wchar_t saveButtonLabels[2][256]; + swprintf( saveButtonLabels[0], 256, L"%ls", app.GetString( IDS_SAVE_GAME )); + swprintf( saveButtonLabels[1], 256, L"%ls", app.GetString( IDS_DISABLE_AUTOSAVE )); + m_buttons[BUTTON_PAUSE_SAVEGAME].setAllPossibleLabels(2,saveButtonLabels); + + if(app.GetGameHostOption(eGameHostOption_DisableSaving) || m_bTrialTexturePack) + { + m_savesDisabled = true; + m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME); + } + else + { + m_savesDisabled = false; + m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_DISABLE_AUTOSAVE),BUTTON_PAUSE_SAVEGAME); + } + } + else + { + m_buttons[BUTTON_PAUSE_SAVEGAME].init(app.GetString(IDS_SAVE_GAME),BUTTON_PAUSE_SAVEGAME); + } + m_buttons[BUTTON_PAUSE_EXITGAME].init(app.GetString(IDS_EXIT_GAME),BUTTON_PAUSE_EXITGAME); if(!ProfileManager.IsFullVersion()) @@ -143,41 +155,46 @@ void UIScene_PauseMenu::tick() { UIScene::tick(); -#ifdef __PSVITA__ - // 4J-MGH - Need to check for installed DLC here, as we delay the installation of the key file on Vita - if(!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(0); -#endif + #ifdef __PSVITA__ + // 4J-MGH - Need to check for installed DLC here, as we delay the installation of the key file on Vita + if(!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(0); + #endif + const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 -#if defined _XBOX_ONE || defined __ORBIS__ - if(!m_bTrialTexturePack && m_savesDisabled != (app.GetGameHostOption(eGameHostOption_DisableSaving) != 0) && ProfileManager.GetPrimaryPad() == m_iPad ) + if (consoleAutosave) { - // We show the save button if saves are disabled as this lets us show a prompt to enable them (via purchasing a texture pack) - if( app.GetGameHostOption(eGameHostOption_DisableSaving) ) + if(!m_bTrialTexturePack && m_savesDisabled != (app.GetGameHostOption(eGameHostOption_DisableSaving) != 0) && ProfileManager.GetPrimaryPad() == m_iPad ) { - m_savesDisabled = true; - m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_SAVE_GAME) ); - } - else - { - m_savesDisabled = false; - m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_DISABLE_AUTOSAVE) ); + // We show the save button if saves are disabled as this lets us show a prompt to enable them (via purchasing a texture pack) + if( app.GetGameHostOption(eGameHostOption_DisableSaving) ) + { + m_savesDisabled = true; + printf("PauseMenu::tick: setLabel IDS_SAVE_GAME (%ls)\n", app.GetString(IDS_SAVE_GAME)); + m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_SAVE_GAME) ); + } + else + { + m_savesDisabled = false; + printf("PauseMenu::tick: setLabel IDS_DISABLE_AUTOSAVE (%ls)\n", app.GetString(IDS_DISABLE_AUTOSAVE)); + m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_DISABLE_AUTOSAVE) ); + } } } -#endif -#ifdef __ORBIS__ - // Process the error dialog (for a patch being available) - if(m_bErrorDialogRunning) - { - SceErrorDialogStatus stat = sceErrorDialogUpdateStatus(); - if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED ) - { - sceErrorDialogTerminate(); - m_bErrorDialogRunning=false; + #ifdef __ORBIS__ + // Process the error dialog (for a patch being available) + if(m_bErrorDialogRunning) + { + SceErrorDialogStatus stat = sceErrorDialogUpdateStatus(); + if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED ) + { + sceErrorDialogTerminate(); + m_bErrorDialogRunning=false; + } } - } -#endif + #endif } void UIScene_PauseMenu::updateTooltips() @@ -239,8 +256,9 @@ void UIScene_PauseMenu::updateComponents() void UIScene_PauseMenu::handlePreReload() { -#if defined _XBOX_ONE || defined __ORBIS__ - if(ProfileManager.GetPrimaryPad() == m_iPad) + const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + if(consoleAutosave && (ProfileManager.GetPrimaryPad() == m_iPad)) { // 4J-TomK - check for all possible labels being fed into BUTTON_PAUSE_SAVEGAME (Bug 163775) // this has to be done before button initialisation! @@ -249,7 +267,6 @@ void UIScene_PauseMenu::handlePreReload() swprintf( saveButtonLabels[1], 256, L"%ls", app.GetString( IDS_DISABLE_AUTOSAVE )); m_buttons[BUTTON_PAUSE_SAVEGAME].setAllPossibleLabels(2,saveButtonLabels); } -#endif } void UIScene_PauseMenu::handleReload() @@ -257,8 +274,10 @@ void UIScene_PauseMenu::handleReload() updateTooltips(); updateControlsVisibility(); -#if defined _XBOX_ONE || defined __ORBIS__ - if(ProfileManager.GetPrimaryPad() == m_iPad) + const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + + if(consoleAutosave && ProfileManager.GetPrimaryPad() == m_iPad) { // We show the save button if saves are disabled as this lets us show a prompt to enable them (via purchasing a texture pack) if( app.GetGameHostOption(eGameHostOption_DisableSaving) || m_bTrialTexturePack ) @@ -272,7 +291,6 @@ void UIScene_PauseMenu::handleReload() m_buttons[BUTTON_PAUSE_SAVEGAME].setLabel( app.GetString(IDS_DISABLE_AUTOSAVE) ); } } -#endif doHorizontalResizeCheck(); } @@ -660,8 +678,12 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) playTime = static_cast(pMinecraft->localplayers[m_iPad]->getSessionTimer()); } -#if defined(_XBOX_ONE) || defined(__ORBIS__) - uiIDA[0]=IDS_CONFIRM_CANCEL; + const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + + if (consoleAutosave) + { + uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; if(g_NetworkManager.IsHost() && StorageManager.GetSaveDisabled()) @@ -676,7 +698,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) } else { - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId()); } } else if(g_NetworkManager.IsHost() && g_NetworkManager.GetPlayerCount()>1) @@ -685,9 +707,11 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) } else { - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId()); } -#else + } + else + { if(StorageManager.GetSaveDisabled()) { uiIDA[0]=IDS_CONFIRM_CANCEL; @@ -708,7 +732,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) } else { - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 3, m_iPad,&UIScene_PauseMenu::ExitGameSaveDialogReturned, (LPVOID)GetCallbackUniqueId()); } } else @@ -716,10 +740,10 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestAlertMessage(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId()); + ui.RequestAlertMessage(IDS_EXIT_GAME, app.GetCorrectExitKey(m_iPad), uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, (LPVOID)GetCallbackUniqueId()); } } -#endif + } } else { @@ -894,8 +918,10 @@ void UIScene_PauseMenu::PerformActionSaveGame() else #endif { -#if defined(_XBOX_ONE) || defined(__ORBIS__) - if(!m_savesDisabled) + const int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType); + const bool consoleAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + + if(consoleAutosave && !m_savesDisabled) { UINT uiIDA[2]; uiIDA[0]=IDS_CANCEL; @@ -903,7 +929,6 @@ void UIScene_PauseMenu::PerformActionSaveGame() ui.RequestAlertMessage(IDS_TITLE_DISABLE_AUTOSAVE, IDS_CONFIRM_DISABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::DisableAutosaveDialogReturned,(LPVOID)GetCallbackUniqueId()); } else -#endif // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { @@ -914,15 +939,18 @@ void UIScene_PauseMenu::PerformActionSaveGame() } else { -#if defined(_XBOX_ONE) || defined(__ORBIS__) - UINT uiIDA[2]; - uiIDA[0]=IDS_CONFIRM_CANCEL; - uiIDA[1]=IDS_CONFIRM_OK; - ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,(LPVOID)GetCallbackUniqueId()); -#else - // flag a app action of save game - app.SetAction(m_iPad,eAppAction_SaveGame); -#endif + if(consoleAutosave) + { + UINT uiIDA[2]; + uiIDA[0]=IDS_CONFIRM_CANCEL; + uiIDA[1]=IDS_CONFIRM_OK; + ui.RequestAlertMessage(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,(LPVOID)GetCallbackUniqueId()); + } + else + { + // flag a app action of save game + app.SetAction(m_iPad,eAppAction_SaveGame); + } } } } diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp index 0bda3045..ed2d01bb 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp @@ -2,6 +2,25 @@ #include "UI.h" #include "UIScene_SettingsOptionsMenu.h" +namespace +{ + void FormatAutosaveSliderLabel(WCHAR *buffer, size_t bufferSize, int value, int controlType) + { + const bool fasterAutosave = (controlType == 0 || controlType == 1 || controlType == 4); // windows, xbox one and ps4 + + if(value == 0) + { + swprintf(buffer, bufferSize, L"%ls", app.GetString(IDS_SLIDER_AUTOSAVE_OFF)); + } + else + { + const int displayValue = fasterAutosave ? value : value * 15; + const wstring unitText = (displayValue == 1) ? L"Min" : app.GetString(IDS_MINUTES); + swprintf(buffer, bufferSize, L"%ls: %d %ls", app.GetString(IDS_SLIDER_AUTOSAVE), displayValue, unitText.c_str()); + } + } +} + int UIScene_SettingsOptionsMenu::m_iDifficultyTitleSettingA[4]= { IDS_DIFFICULTY_TITLE_PEACEFUL, @@ -65,6 +84,7 @@ void UIScene_SettingsOptionsMenu::tick() m_multiList.AddNewCheckbox(app.GetString(IDS_VIEW_BOBBING), eControl_ViewBob, (app.GetGameSettings(m_iPad,eGameSetting_ViewBob)!=0)); m_multiList.AddNewCheckbox(app.GetString(IDS_HINTS), eControl_Hints, (app.GetGameSettings(m_iPad,eGameSetting_Hints)!=0)); m_multiList.AddNewCheckbox(app.GetString(IDS_CHECKBOX_DEATH_MESSAGES), eControl_DeathMessages, (app.GetGameSettings(m_iPad,eGameSetting_DeathMessages)!=0)); + m_multiList.AddNewCheckbox(L"Passive Chunk Loading", eControl_PassiveChunkLoading, (app.GetGameSettings(m_iPad,eGameSetting_PassiveChunkLoading)!=0)); if(m_bNotInGame) { @@ -74,10 +94,7 @@ void UIScene_SettingsOptionsMenu::tick() WCHAR TempString[256]; int autosaveVal = app.GetGameSettings(m_iPad,eGameSetting_Autosave); - if(autosaveVal == 0) - swprintf(TempString, 256, L"%ls", app.GetString(IDS_SLIDER_AUTOSAVE_OFF)); - else - swprintf(TempString, 256, L"%ls: %d %ls", app.GetString(IDS_SLIDER_AUTOSAVE), autosaveVal*15, app.GetString(IDS_MINUTES)); + FormatAutosaveSliderLabel(TempString, 256, autosaveVal, app.GetGameSettings(m_iPad, eGameSetting_ControlType)); m_multiList.AddNewSlider(TempString, eControl_Autosave, 0, 8, 1, autosaveVal); swprintf(TempString, 256, L"%ls: %d%%", app.GetString(IDS_SLIDER_SENSITIVITY_INGAME), app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame)); @@ -115,10 +132,7 @@ void UIScene_SettingsOptionsMenu::tick() case eControl_Autosave: app.SetGameSettings(m_iPad, eGameSetting_Autosave, m_iPendingSliderValue); app.SetAutosaveTimerTime(); - if(m_iPendingSliderValue == 0) - swprintf(TempString, 256, L"%ls", app.GetString(IDS_SLIDER_AUTOSAVE_OFF)); - else - swprintf(TempString, 256, L"%ls: %d %ls", app.GetString(IDS_SLIDER_AUTOSAVE), m_iPendingSliderValue*15, app.GetString(IDS_MINUTES)); + FormatAutosaveSliderLabel(TempString, 256, m_iPendingSliderValue, app.GetGameSettings(m_iPad, eGameSetting_ControlType)); m_multiList.SetSliderLabel(eControl_Autosave, TempString); break; case eControl_Sensitivity_InGame: @@ -233,6 +247,7 @@ void UIScene_SettingsOptionsMenu::setGameSettings() app.SetGameSettings(m_iPad,eGameSetting_ViewBob,m_multiList.GetCheckboxValue(eControl_ViewBob)?1:0); app.SetGameSettings(m_iPad,eGameSetting_Hints,m_multiList.GetCheckboxValue(eControl_Hints)?1:0); app.SetGameSettings(m_iPad,eGameSetting_DeathMessages,m_multiList.GetCheckboxValue(eControl_DeathMessages)?1:0); + app.SetGameSettings(m_iPad,eGameSetting_PassiveChunkLoading,m_multiList.GetCheckboxValue(eControl_PassiveChunkLoading)?1:0); app.SetGameSettings(m_iPad,eGameSetting_Autosave,m_multiList.GetSliderValue(eControl_Autosave)); app.SetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame,m_multiList.GetSliderValue(eControl_Sensitivity_InGame)); app.SetGameSettings(m_iPad,eGameSetting_Difficulty,m_multiList.GetSliderValue(eControl_Difficulty)); diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.h b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.h index 1b18fc4f..91779f56 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.h @@ -13,10 +13,11 @@ private: eControl_ViewBob = 2, eControl_Hints = 3, eControl_DeathMessages = 4, - eControl_Languages = 5, - eControl_Autosave = 6, - eControl_Sensitivity_InGame = 7, - eControl_Difficulty = 8, + eControl_PassiveChunkLoading = 5, + eControl_Languages = 6, + eControl_Autosave = 7, + eControl_Sensitivity_InGame = 8, + eControl_Difficulty = 9, }; UIControl_MultiList m_multiList; diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index db2da718..2fd6cfcc 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -673,6 +673,7 @@ static void Win64_ApplyDefaultProfileGameSettings(void* profileBytes) pGameSettings->uiBitmaskValues |= GAMESETTING_DISPLAYHAND; //eGameSetting_DisplayHand - on pGameSettings->uiBitmaskValues |= GAMESETTING_CUSTOMSKINANIM; //eGameSetting_CustomSkinAnim - on pGameSettings->uiBitmaskValues |= GAMESETTING_DEATHMESSAGES; //eGameSetting_DeathMessages - on + pGameSettings->uiBitmaskValues &= ~GAMESETTING_PASSIVECHUNKLOADING; //eGameSetting_PassiveChunkLoading - off pGameSettings->uiBitmaskValues |= (GAMESETTING_UISIZE & 0x00000800); // uisize 2 pGameSettings->uiBitmaskValues |= (GAMESETTING_UISIZE_SPLITSCREEN & 0x00004000); // splitscreen ui size 3 pGameSettings->uiBitmaskValues |= GAMESETTING_ANIMATEDCHARACTER; //eGameSetting_AnimatedCharacter - on diff --git a/Minecraft.Client/ItemFrameRenderer.cpp b/Minecraft.Client/ItemFrameRenderer.cpp index b297c546..7ef3d20d 100644 --- a/Minecraft.Client/ItemFrameRenderer.cpp +++ b/Minecraft.Client/ItemFrameRenderer.cpp @@ -45,7 +45,7 @@ void ItemFrameRenderer::render(shared_ptr _itemframe, double x, double float back = 0.0f; // set offset to 1 if the item frame is not placed by the player - if (itemFrame->level->isClientSide && !itemFrame->placedByPlayer) + if (itemFrame->level->isClientSide && itemFrame->placedByTutorial) { back = 1.0f; } diff --git a/Minecraft.Client/ItemRenderer.cpp b/Minecraft.Client/ItemRenderer.cpp index a85866a9..843c9fd9 100644 --- a/Minecraft.Client/ItemRenderer.cpp +++ b/Minecraft.Client/ItemRenderer.cpp @@ -124,8 +124,9 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do glScalef(s, s, s); - bool bSlimeItem = (tile != nullptr && tile->id == Tile::slimeBlock->id); - if (bSlimeItem) + bool bTranslucentBlockItem = (tile != nullptr && tile->getRenderLayer() >= 2); + + if (bTranslucentBlockItem) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_ALPHA_TEST); @@ -149,7 +150,7 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do glPopMatrix(); } - if (bSlimeItem) + if (bTranslucentBlockItem) { glDepthMask(true); glEnable(GL_ALPHA_TEST); diff --git a/Minecraft.Client/LevelRenderer.cpp b/Minecraft.Client/LevelRenderer.cpp index 849e6a0d..a7578092 100644 --- a/Minecraft.Client/LevelRenderer.cpp +++ b/Minecraft.Client/LevelRenderer.cpp @@ -1956,6 +1956,7 @@ void LevelRenderer::renderAdvancedClouds(float alpha) bool LevelRenderer::updateDirtyChunks() { + bool passiveChunkLoading = app.GetGameSettings(ProfileManager.GetPrimaryPad(), eGameSetting_PassiveChunkLoading); #ifdef _LARGE_WORLDS std::list< std::pair > nearestClipChunks; #endif @@ -2182,13 +2183,90 @@ bool LevelRenderer::updateDirtyChunks() Chunk *chunk = nullptr; -#ifdef _LARGE_WORLDS - if(!nearestClipChunks.empty()) + bool bHasRebuildWork = false; + + if( passiveChunkLoading == 0 ) { - int index = 0; - for(auto & it : nearestClipChunks) + if(!nearestClipChunks.empty()) { - chunk = it.first->chunk; + int index = 0; + for(auto & it : nearestClipChunks) + { + chunk = it.first->chunk; + // If this chunk is very near, then move the renderer into a deferred mode. This won't commit any command buffers + // for rendering until we call CBuffDeferredModeEnd(), allowing us to group any near changes into an atomic unit. This + // is essential so we don't temporarily create any holes in the environment whilst updating one chunk and not the neighbours. + // The "ver near" aspect of this is just a cosmetic nicety - exactly the same thing would happen further away, but we just don't + // care about it so much from terms of visual impact. + if( veryNearCount > 0 ) + { + RenderManager.CBuffDeferredModeStart(); + } + // Build this chunk & return false to continue processing + chunk->clearDirty(); + // Take a copy of the details that are required for chunk rebuilding, and rebuild That instead of the original chunk data. This is done within + // the m_csDirtyChunks critical section, which means that any chunks can't be repositioned whilst we are doing this copy. The copy will then + // be guaranteed to be consistent whilst rebuilding takes place outside of that critical section. + permaChunk[index].makeCopyForRebuild(chunk); + ++index; + } + LeaveCriticalSection(&m_csDirtyChunks); + + --index; // Bring it back into 0 counted range + + for(int i = MAX_CHUNK_REBUILD_THREADS - 1; i >= 0; --i) + { + // Set the events that won't run + if( (i+1) > index) s_rebuildCompleteEvents->Set(i); + else break; + } + + for(; index >=0; --index) + { + bool bAtomic = false; + if((veryNearCount > 0)) + bAtomic = true; //MGH - if veryNearCount, then we're trying to rebuild atomically, so do it all on the main thread + + if( bAtomic || (index == 0) ) + { + //PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); + + //app.DebugPrintf("Rebuilding permaChunk %d\n", index); + + permaChunk[index].rebuild(); + + if(index !=0) + s_rebuildCompleteEvents->Set(index-1); // MGH - this rebuild happening on the main thread instead, mark the thread it should have been running on as complete + + // int64_t endTime = System::currentTimeMillis(); + // totalTime += (endTime - startTime); + // countTime++; + // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); + //PIXEndNamedEvent(); + } + // 4J Stu - Ignore this path when in constrained mode on Xbox One + else + { + // Activate thread to rebuild this chunk + s_activationEventA[index - 1]->Set(); + } + } + + // Wait for the other threads to be done as well + s_rebuildCompleteEvents->WaitForAll(INFINITE); + + bHasRebuildWork = true; + } + } + else + { + if( nearChunk ) + { + chunk = nearChunk->chunk; + PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z); // If this chunk is very near, then move the renderer into a deferred mode. This won't commit any command buffers // for rendering until we call CBuffDeferredModeEnd(), allowing us to group any near changes into an atomic unit. This // is essential so we don't temporarily create any holes in the environment whilst updating one chunk and not the neighbours. @@ -2203,91 +2281,24 @@ bool LevelRenderer::updateDirtyChunks() // Take a copy of the details that are required for chunk rebuilding, and rebuild That instead of the original chunk data. This is done within // the m_csDirtyChunks critical section, which means that any chunks can't be repositioned whilst we are doing this copy. The copy will then // be guaranteed to be consistent whilst rebuilding takes place outside of that critical section. - permaChunk[index].makeCopyForRebuild(chunk); - ++index; + static Chunk permaChunk; + permaChunk.makeCopyForRebuild(chunk); + LeaveCriticalSection(&m_csDirtyChunks); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); + permaChunk.rebuild(); + // int64_t endTime = System::currentTimeMillis(); + // totalTime += (endTime - startTime); + // countTime++; + // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); + PIXEndNamedEvent(); + + bHasRebuildWork = true; } - LeaveCriticalSection(&m_csDirtyChunks); - - --index; // Bring it back into 0 counted range - - for(int i = MAX_CHUNK_REBUILD_THREADS - 1; i >= 0; --i) - { - // Set the events that won't run - if( (i+1) > index) s_rebuildCompleteEvents->Set(i); - else break; - } - - for(; index >=0; --index) - { - bool bAtomic = false; - if((veryNearCount > 0)) - bAtomic = true; //MGH - if veryNearCount, then we're trying to rebuild atomically, so do it all on the main thread - - if( bAtomic || (index == 0) ) - { - //PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z); - // static int64_t totalTime = 0; - // static int64_t countTime = 0; - // int64_t startTime = System::currentTimeMillis(); - - //app.DebugPrintf("Rebuilding permaChunk %d\n", index); - - permaChunk[index].rebuild(); - - if(index !=0) - s_rebuildCompleteEvents->Set(index-1); // MGH - this rebuild happening on the main thread instead, mark the thread it should have been running on as complete - - // int64_t endTime = System::currentTimeMillis(); - // totalTime += (endTime - startTime); - // countTime++; - // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); - //PIXEndNamedEvent(); - } - // 4J Stu - Ignore this path when in constrained mode on Xbox One - else - { - // Activate thread to rebuild this chunk - s_activationEventA[index - 1]->Set(); - } - } - - // Wait for the other threads to be done as well - s_rebuildCompleteEvents->WaitForAll(INFINITE); } -#else - if( nearChunk ) - { - chunk = nearChunk->chunk; - PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z); - // If this chunk is very near, then move the renderer into a deferred mode. This won't commit any command buffers - // for rendering until we call CBuffDeferredModeEnd(), allowing us to group any near changes into an atomic unit. This - // is essential so we don't temporarily create any holes in the environment whilst updating one chunk and not the neighbours. - // The "ver near" aspect of this is just a cosmetic nicety - exactly the same thing would happen further away, but we just don't - // care about it so much from terms of visual impact. - if( veryNearCount > 0 ) - { - RenderManager.CBuffDeferredModeStart(); - } - // Build this chunk & return false to continue processing - chunk->clearDirty(); - // Take a copy of the details that are required for chunk rebuilding, and rebuild That instead of the original chunk data. This is done within - // the m_csDirtyChunks critical section, which means that any chunks can't be repositioned whilst we are doing this copy. The copy will then - // be guaranteed to be consistent whilst rebuilding takes place outside of that critical section. - static Chunk permaChunk; - permaChunk.makeCopyForRebuild(chunk); - LeaveCriticalSection(&m_csDirtyChunks); - // static int64_t totalTime = 0; - // static int64_t countTime = 0; - // int64_t startTime = System::currentTimeMillis(); - permaChunk.rebuild(); - // int64_t endTime = System::currentTimeMillis(); - // totalTime += (endTime - startTime); - // countTime++; - // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); - PIXEndNamedEvent(); - } -#endif - else + + if( !bHasRebuildWork ) { // Nothing to do - clear flags that there are things to process, unless it's been a while since we found any dirty chunks in which case force a check next time through // Scale recheck period with render distance to reduce wasted full-scans at high distances @@ -3174,6 +3185,11 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle int id = PARTICLE_CRACK_ID(eParticleType), data = PARTICLE_CRACK_DATA(eParticleType); particle = std::make_shared(lev, x, y, z, xa, ya, za, Item::items[id], textures, data); } + else if( ( eParticleType >= eParticleType_blockdust_base ) && ( eParticleType <= eParticleType_blockdust_last ) ) + { + int id = PARTICLE_CRACK_ID(eParticleType), data = PARTICLE_CRACK_DATA(eParticleType); + particle = dynamic_pointer_cast(std::make_shared(lev, x, y, z, xa, ya, za, Tile::tiles[id], 0, data, textures, false)->init(data) ); + } else if( ( eParticleType >= eParticleType_tilecrack_base ) && ( eParticleType <= eParticleType_tilecrack_last ) ) { int id = PARTICLE_CRACK_ID(eParticleType), data = PARTICLE_CRACK_DATA(eParticleType); diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 77fa7653..308d46a8 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -3045,6 +3045,15 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } break; + case eTYPE_CREEPER: + { + // if currently holding flint and steel + if (heldItemId == Item::flint_and_steel_Id) + *piUse=IDS_TOOLTIPS_IGNITE; + + *piAction=IDS_TOOLTIPS_HIT; + } + break; case eTYPE_COW: { if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; @@ -3622,7 +3631,18 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } // 4J-JEV: Don't set tooltips when we're reloading the skin, it'll crash. - if (!ui.IsReloadingSkin()) ui.SetTooltips( iPad, iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS); + if (!ui.IsReloadingSkin()) + { + int uiControlType = app.GetGameSettings(iPad, eGameSetting_ControlType); + if (uiControlType == 0) + { + ui.SetTooltips(iPad, iA, iB, iX, iY, iRT, iLT, iLB, iRB, iLS, iRS); // flip left and right triggers on kbm + } + else + { + ui.SetTooltips(iPad, iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS); + } + } int wheel = 0; if (InputManager.GetValue(iPad, MINECRAFT_ACTION_LEFT_SCROLL, true) > 0 && gameMode->isInputAllowed(MINECRAFT_ACTION_LEFT_SCROLL) ) @@ -4571,8 +4591,20 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt // Stop menu music and transition to game music for the new level if (soundEngine != nullptr) { - soundEngine->stopStreamingNow(); - soundEngine->playStreaming(L"", 0, 0, 0, 1, 1); + const bool hasCustomMusic = (Minecraft::GetInstance() != nullptr && + Minecraft::GetInstance()->skins != nullptr && + Minecraft::GetInstance()->skins->getSelected() != nullptr && + Minecraft::GetInstance()->skins->getSelected()->hasAudio()); + const bool isMenuMusic = soundEngine->isPlayingMenuMusic(); + + if (hasCustomMusic || !isMenuMusic) + { + if (level != nullptr) + { + soundEngine->stopStreamingNow(); + } + soundEngine->playStreaming(L"", 0, 0, 0, 1, 1); + } } // 4J - stop update thread from processing this level, which blocks until it is safe to move on - will be re-enabled if we set the level to be non-nullptr diff --git a/Minecraft.Client/Particle.cpp b/Minecraft.Client/Particle.cpp index 4d4b4654..23d44f90 100644 --- a/Minecraft.Client/Particle.cpp +++ b/Minecraft.Client/Particle.cpp @@ -98,7 +98,7 @@ Particle::Particle(Level *level, double x, double y, double z) : Entity(nullptr, } } -Particle::Particle(Level *level, double x, double y, double z, double xa, double ya, double za) : Entity(nullptr, false) +Particle::Particle(Level *level, double x, double y, double z, double xa, double ya, double za, bool useRandomizedLogic) : Entity(nullptr, false) { _init(level,x,y,z); @@ -113,15 +113,28 @@ Particle::Particle(Level *level, double x, double y, double z, double xa, double this->level = nullptr; } - xd = xa + static_cast(Math::random() * 2 - 1) * 0.4f; - yd = ya + static_cast(Math::random() * 2 - 1) * 0.4f; - zd = za + static_cast(Math::random() * 2 - 1) * 0.4f; - float speed = static_cast(Math::random() + Math::random() + 1) * 0.15f; + if (useRandomizedLogic) { + xd = xa + static_cast(Math::random() * 2 - 1) * 0.4f; + yd = ya + static_cast(Math::random() * 2 - 1) * 0.4f; + zd = za + static_cast(Math::random() * 2 - 1) * 0.4f; + float speed = static_cast(Math::random() + Math::random() + 1) * 0.15f; - float dd = (float) (Mth::sqrt(xd * xd + yd * yd + zd * zd)); - xd = xd / dd * speed * 0.4f; - yd = yd / dd * speed * 0.4f + 0.1f; - zd = zd / dd * speed * 0.4f;} + float dd = (float) (Mth::sqrt(xd * xd + yd * yd + zd * zd)); + xd = xd / dd * speed * 0.4f; + yd = yd / dd * speed * 0.4f + 0.1f; + zd = zd / dd * speed * 0.4f; + } + else { + xd = xa; + yd = ya; + zd = za; + } +} + + +Particle::Particle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z, xa, ya, za, true) +{ +} shared_ptr Particle::setPower(float power) { diff --git a/Minecraft.Client/Particle.h b/Minecraft.Client/Particle.h index 2bfcf2a4..2c6260dc 100644 --- a/Minecraft.Client/Particle.h +++ b/Minecraft.Client/Particle.h @@ -28,6 +28,7 @@ protected: Particle(Level *level, double x, double y, double z); public: Particle(Level *level, double x, double y, double z, double xa, double ya, double za); + Particle(Level *level, double x, double y, double z, double xa, double ya, double za, bool useRandomizedLogic); virtual shared_ptr setPower(float power); virtual shared_ptr scale(float scale); void setColor(float r, float g, float b); diff --git a/Minecraft.Client/ParticleType.cpp b/Minecraft.Client/ParticleType.cpp index 30dc0721..8c03d672 100644 --- a/Minecraft.Client/ParticleType.cpp +++ b/Minecraft.Client/ParticleType.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" +#include #include "ParticleType.h" ParticleType::ParticleType(const std::string& name, int id, bool overrideLimiter, int paramCount) @@ -10,6 +11,19 @@ ParticleType::ParticleType(const std::string& name, int id, bool overrideLimiter this->paramCount = paramCount; } +const ParticleType* ParticleType::blockdust = new ParticleType("blockdust_", 0x29, false, 1); +const ParticleType* ParticleType::blockcrack = new ParticleType("blockcrack_", 0x28, false, 2); + +static std::unordered_map& particleRegistry() +{ + static std::unordered_map registry = { + { ParticleType::blockdust->getId(), ParticleType::blockdust }, + { ParticleType::blockcrack->getId(), ParticleType::blockcrack }, + }; + return registry; +} + + int ParticleType::getId() const { return id; @@ -34,6 +48,7 @@ const ParticleType* ParticleType::getDefault() const ParticleType* ParticleType::byId(int searchId) { - - return nullptr; + auto& reg = particleRegistry(); + auto it = reg.find(searchId); + return (it != reg.end()) ? it->second : nullptr; } \ No newline at end of file diff --git a/Minecraft.Client/ParticleType.h b/Minecraft.Client/ParticleType.h index 7b3459f9..735a9930 100644 --- a/Minecraft.Client/ParticleType.h +++ b/Minecraft.Client/ParticleType.h @@ -20,4 +20,7 @@ public: static const ParticleType* byId(int id); static const ParticleType* getDefault(); + + static const ParticleType* blockdust; + static const ParticleType* blockcrack; }; \ No newline at end of file diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index d0f99c5c..e4dc4144 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -1475,7 +1475,7 @@ if (cmd == L"tp" || cmd == L"teleport") shared_ptr packet = GiveItemCommand::preparePacket(target, item, amount, aux); server->getCommandDispatcher()->performCommand(player, eGameCommand_Give, packet->data); } -#ifndef _CONTENT_PACKAGE +#ifdef _DEBUG else if (cmd == L"spectator") { player->m_spectatorMode = !player->m_spectatorMode; diff --git a/Minecraft.Client/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index 7a8bcf57..1ba6a85a 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -1686,11 +1686,22 @@ void ServerLevel::flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFoun } void ServerLevel::sendParticles(const ParticleType* type, bool longDistance, double x, double y, double z, int count, double dx, double dy, double dz, double speed, arrayWithLength data) { - wchar_t buf[32]; - swprintf_s(buf, L"%d", type->getId()); + wstring particleName; + if (type != nullptr && type->getId() == ParticleType::blockdust->getId() && data.length > 0) + { + int tileId = data[0] & Tile::TILE_NUM_MASK; + int tileData = (data[0] >> Tile::TILE_NUM_SHIFT) & 0xFF; + particleName = std::to_wstring(PARTICLE_BLOCKDUST(tileId, tileData)); + } + else + { + wchar_t buf[32]; + swprintf_s(buf, L"%d", type != nullptr ? type->getId() : 0); + particleName = buf; + } auto packet = make_shared( - buf, + particleName, (float)x, (float)y, (float)z, (float)dx, (float)dy, (float)dz, (float)speed, diff --git a/Minecraft.Client/TerrainParticle.cpp b/Minecraft.Client/TerrainParticle.cpp index ef10f8f9..c1fc7973 100644 --- a/Minecraft.Client/TerrainParticle.cpp +++ b/Minecraft.Client/TerrainParticle.cpp @@ -5,7 +5,11 @@ #include "../Minecraft.World/net.minecraft.world.level.h" #include "../Minecraft.World/net.minecraft.world.h" -TerrainParticle::TerrainParticle(Level *level, double x, double y, double z, double xa, double ya, double za, Tile *tile, int face, int data, Textures *textures) : Particle(level, x, y, z, xa, ya, za) +TerrainParticle::TerrainParticle(Level *level, double x, double y, double z, double xa, double ya, double za, Tile *tile, int face, int data, Textures *textures) : TerrainParticle(level, x, y, z, xa, ya, za, tile, face, data, textures, true) +{ +} + +TerrainParticle::TerrainParticle(Level *level, double x, double y, double z, double xa, double ya, double za, Tile *tile, int face, int data, Textures *textures, bool useRandomizedLogic) : Particle(level, x, y, z, xa, ya, za, useRandomizedLogic) { this->tile = tile; if (tile == nullptr) return; // tu31 tutorial world fix diff --git a/Minecraft.Client/TerrainParticle.h b/Minecraft.Client/TerrainParticle.h index 5d4a743f..aa79fac8 100644 --- a/Minecraft.Client/TerrainParticle.h +++ b/Minecraft.Client/TerrainParticle.h @@ -11,6 +11,7 @@ private: public: TerrainParticle(Level *level, double x, double y, double z, double xa, double ya, double za, Tile *tile, int face, int data, Textures *textures); + TerrainParticle(Level *level, double x, double y, double z, double xa, double ya, double za, Tile *tile, int face, int data, Textures *textures, bool useRandomizedLogic); shared_ptr init(int x, int y, int z, int data); // 4J - added data parameter shared_ptr init(int data); virtual int getParticleTexture(); diff --git a/Minecraft.Client/TrackedEntity.cpp b/Minecraft.Client/TrackedEntity.cpp index 82965bbd..5bd13ce0 100644 --- a/Minecraft.Client/TrackedEntity.cpp +++ b/Minecraft.Client/TrackedEntity.cpp @@ -846,6 +846,10 @@ shared_ptr TrackedEntity::getAddEntityPacket() { data |= 0x100; } + if (frame->placedByTutorial) + { + data |= 0x200; + } shared_ptr packet = std::make_shared(e, AddEntityPacket::ITEM_FRAME, data, yRotp, xRotp, xp, yp, zp); packet->x = Mth::floor(frame->xTile * 32.0f); packet->y = Mth::floor(frame->yTile * 32.0f); diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break1.ogg new file mode 100644 index 00000000..157b17d3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break2.ogg new file mode 100644 index 00000000..b9cfe957 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break3.ogg new file mode 100644 index 00000000..9dac68f7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break4.ogg new file mode 100644 index 00000000..6a4261d7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/break4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit1.ogg new file mode 100644 index 00000000..2f077fe8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit2.ogg new file mode 100644 index 00000000..544713b7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit3.ogg new file mode 100644 index 00000000..50d410cc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit4.ogg new file mode 100644 index 00000000..86ff0f5b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/armorstand/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk1.ogg new file mode 100644 index 00000000..c24d7bfe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk2.ogg new file mode 100644 index 00000000..9cd31963 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk3.ogg new file mode 100644 index 00000000..92d902fd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/cow/milk3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient1.ogg new file mode 100644 index 00000000..f69a4816 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient2.ogg new file mode 100644 index 00000000..68c5d7ff Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient3.ogg new file mode 100644 index 00000000..fe886531 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient4.ogg new file mode 100644 index 00000000..d8ab420a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/guardian/ambient4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat1.ogg new file mode 100644 index 00000000..f6024711 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat2.ogg new file mode 100644 index 00000000..fc672fe2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat3.ogg new file mode 100644 index 00000000..b8c761d9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat4.ogg new file mode 100644 index 00000000..1b495872 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat5.ogg new file mode 100644 index 00000000..1c8da51e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/horse/eat5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item1.ogg new file mode 100644 index 00000000..259a4ed4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item2.ogg new file mode 100644 index 00000000..3725deb5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item3.ogg new file mode 100644 index 00000000..8cc965db Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item4.ogg new file mode 100644 index 00000000..79d15da6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/add_item4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break1.ogg new file mode 100644 index 00000000..b331fcca Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break2.ogg new file mode 100644 index 00000000..12f6d730 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break3.ogg new file mode 100644 index 00000000..a44343d8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/break3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place1.ogg new file mode 100644 index 00000000..58cd609e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place2.ogg new file mode 100644 index 00000000..bd5b53b2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place3.ogg new file mode 100644 index 00000000..ed5d21d7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place4.ogg new file mode 100644 index 00000000..9fa8a2be Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/place4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item1.ogg new file mode 100644 index 00000000..36451760 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item2.ogg new file mode 100644 index 00000000..f9e834e2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item3.ogg new file mode 100644 index 00000000..9b729598 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item4.ogg new file mode 100644 index 00000000..3dd60a09 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/remove_item4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item1.ogg new file mode 100644 index 00000000..197d78a5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item2.ogg new file mode 100644 index 00000000..391efb8d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item3.ogg new file mode 100644 index 00000000..bb964a51 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item4.ogg new file mode 100644 index 00000000..5632717f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/itemframe/rotate_item4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break1.ogg new file mode 100644 index 00000000..acbb9412 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break2.ogg new file mode 100644 index 00000000..238314a3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break3.ogg new file mode 100644 index 00000000..faf0bc06 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/break3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place1.ogg new file mode 100644 index 00000000..f5058382 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place2.ogg new file mode 100644 index 00000000..d54853e4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place3.ogg new file mode 100644 index 00000000..970c687d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/leashknot/place3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break1.ogg new file mode 100644 index 00000000..55bf14ad Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break2.ogg new file mode 100644 index 00000000..37e7dfba Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break3.ogg new file mode 100644 index 00000000..44b0dd02 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/break3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place1.ogg new file mode 100644 index 00000000..ea6e9fd6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place2.ogg new file mode 100644 index 00000000..f7111008 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place3.ogg new file mode 100644 index 00000000..cfd5ecc8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place4.ogg new file mode 100644 index 00000000..41a3dd23 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/painting/place4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit1.ogg new file mode 100644 index 00000000..98f0c859 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit2.ogg new file mode 100644 index 00000000..80c1da52 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit3.ogg new file mode 100644 index 00000000..cf3ac681 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/crit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback1.ogg new file mode 100644 index 00000000..50b31194 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback2.ogg new file mode 100644 index 00000000..edc6a7bc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback3.ogg new file mode 100644 index 00000000..6ad08034 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback4.ogg new file mode 100644 index 00000000..5ddb6740 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/knockback4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong1.ogg new file mode 100644 index 00000000..d91af7fe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong2.ogg new file mode 100644 index 00000000..a11ec607 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong3.ogg new file mode 100644 index 00000000..2d6bb7ba Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong4.ogg new file mode 100644 index 00000000..ce6a115c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong5.ogg new file mode 100644 index 00000000..7643da5e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong6.ogg new file mode 100644 index 00000000..bbc4cd50 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/strong6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep1.ogg new file mode 100644 index 00000000..6ce121fc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep2.ogg new file mode 100644 index 00000000..b3fa2720 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep3.ogg new file mode 100644 index 00000000..001bde5e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep4.ogg new file mode 100644 index 00000000..72078d92 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep5.ogg new file mode 100644 index 00000000..f8ade098 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep6.ogg new file mode 100644 index 00000000..82a38b5e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep7.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep7.ogg new file mode 100644 index 00000000..73c8cf67 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/sweep7.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak1.ogg new file mode 100644 index 00000000..abc3a582 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak2.ogg new file mode 100644 index 00000000..ec351509 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak3.ogg new file mode 100644 index 00000000..178dddec Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak4.ogg new file mode 100644 index 00000000..0744d24a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/player/attack/weak4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack1.ogg new file mode 100644 index 00000000..678d34c8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack2.ogg new file mode 100644 index 00000000..9c8de50b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack3.ogg new file mode 100644 index 00000000..092bc9b8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack4.ogg new file mode 100644 index 00000000..a4c1e1c5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/rabbit/attack4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death1.ogg new file mode 100644 index 00000000..fe8c796f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death2.ogg new file mode 100644 index 00000000..fb542a3a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death3.ogg new file mode 100644 index 00000000..a334224f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/death3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt1.ogg new file mode 100644 index 00000000..a1c54f81 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt2.ogg new file mode 100644 index 00000000..1452086d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt3.ogg new file mode 100644 index 00000000..5e89415f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/snowman/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient1.ogg new file mode 100644 index 00000000..6fd56342 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient2.ogg new file mode 100644 index 00000000..d7c7bfcb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient3.ogg new file mode 100644 index 00000000..88adaa65 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient4.ogg new file mode 100644 index 00000000..ff811182 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient5.ogg new file mode 100644 index 00000000..7b4ef6ec Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/ambient5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death1.ogg new file mode 100644 index 00000000..14e68b18 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death2.ogg new file mode 100644 index 00000000..8c30e006 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death3.ogg new file mode 100644 index 00000000..05629ea7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/death3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt1.ogg new file mode 100644 index 00000000..3f2e4bf6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt2.ogg new file mode 100644 index 00000000..6ac6c5e3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt3.ogg new file mode 100644 index 00000000..74dde1bb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt4.ogg new file mode 100644 index 00000000..fbbe26b3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/squid/hurt4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient1.ogg new file mode 100644 index 00000000..9fd7b264 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient2.ogg new file mode 100644 index 00000000..209009a5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient3.ogg new file mode 100644 index 00000000..43681dba Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient4.ogg new file mode 100644 index 00000000..169e741f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient5.ogg new file mode 100644 index 00000000..702fcd6a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/ambient5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death1.ogg new file mode 100644 index 00000000..fc92472c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death2.ogg new file mode 100644 index 00000000..54a02ab3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death3.ogg new file mode 100644 index 00000000..9185e75b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/death3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink1.ogg new file mode 100644 index 00000000..10989ab2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink2.ogg new file mode 100644 index 00000000..8989734f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink3.ogg new file mode 100644 index 00000000..6cd51b6a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink4.ogg new file mode 100644 index 00000000..4d951665 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/drink4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt1.ogg new file mode 100644 index 00000000..ce0b98bd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt2.ogg new file mode 100644 index 00000000..2fd31fec Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt3.ogg new file mode 100644 index 00000000..f81ea8d5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw1.ogg new file mode 100644 index 00000000..ef3c81dd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw2.ogg new file mode 100644 index 00000000..5467658d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw3.ogg new file mode 100644 index 00000000..d4fc993a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/witch/throw3.ogg differ diff --git a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index 8ff84656..6ab2ae0b 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -628,40 +628,62 @@ so they can easily join you. {*T3*}Changes and Additions{*ETW*}{*B*} - {*T3*}neoLegacy v1.1.0b{*ETW*}{*B*}{*B*} + {*T3*}neoLegacy v1.1.1b{*ETW*}{*B*}{*B*} + Additions{*B*} - - Release builds now feature a logging system for developer debugging.{*B*}{*B*} - - Spectator mode has been added into Debug builds of neoLegacy.{*B*}{*B*} - - Added the Mario world into the game.{*B*}{*B*} - - Added all the TU43-related blocks into the game.{*B*}{*B*} - - Igloos and Fossils can now be found throughout the world.{*B*}{*B*} + - Banner patterns have been added to the game.{*B*}{*B*} + - Keyboard and mouse support has been fully added to the game, featuring improved graphics.{*B*}{*B*} + - Impact particles are now created when the player falls from a high distance.{*B*}{*B*} + - Additional sounds have been added for armor stands, cows, horses, item frames, paintings, and leads.{*B*}{*B*} + - A passive chunk loading option has been added to the 'Game Options' menu, featuring improved stability for lower-end devices.{*B*}{*B*} + - Support for additional languages (Czech, Danish, Greek, Finnish, Norwegian, Polish, and others) has been added to the game.{*B*}{*B*} + + Changes{*B*} + - Creepers now feature an 'Ignite' tooltip whilst holding a flint and steel.{*B*}{*B*} + - Panorama settings are now customizable to increase widespread DLC support.{*B*}{*B*} + - Host privileges are now enabled by default when creating a Creative Mode world.{*B*}{*B*} Welcome back! You may not have noticed, but your Minecraft has just been updated. - {*T3*}neoLegacy v1.1.0b{*ETW*} + {*T3*}neoLegacy v1.1.1b{*ETW*} + Additions - - Release builds now feature a logging system for developer debugging. - - Spectator mode has been added into Debug builds of neoLegacy. - - Added the Mario world into the game. - - Added all the TU43-related blocks into the game. - - Igloos and Fossils can now be found throughout the game. + - Added banner patterns. + - Added full keyboard and mouse support, including improved graphics. + - Added impact particles when players fall from significant heights. + - Added additional sounds for armor stands, cows, horses, item frames, paintings, and leads. + - Added a Passive Chunk Loading option to the Game Options menu, with improved stability on lower-end devices. + - Added support for additional languages, including Czech, Danish, Greek, Finnish, Norwegian, Polish, and more. + Changes - - neoLegacy branding has been added on the title screen. - - Dedicated servers now feature numerous stability improvements + bugfixes. - - Cow sounds have been updated to match their TU31 counterparts. - - The neoLegacy save format is now universal, meaning that anyone can make a DLC world purely from own unique saves. - - World generation has been updated to closely match the original Legacy Console Edition. - - Elytra has been updated with additional accuracy improvements. - - Animated textures have been updated to smoothly interpolate between frames. + - Creepers now display an "Ignite" tooltip when holding a flint and steel. + - Panorama settings are now customizable to improve DLC compatibility. + - Host Privileges are now enabled by default when creating a Creative Mode world. + Bug Fixes - - Flower pots can now properly store all flower variants when interacted with. - - The in-game localization menu no longer crashes when switching between Japanese, Chinese, or Korean languages. - - Jukeboxes now play audio correctly, causing the in-game soundtrack to fade out before playing any music. - - The zombie villager model has been updated to match the new 64x64 skin changes. - - neoLegacy dedicated servers no longer crash due to missing color files. + - Fixed main menu music not transitioning correctly when switching worlds. + - Fixed Debug builds on Linux not functioning correctly. + - Fixed fossils generating underwater or entirely as coal ore. + - Improved magma block generation for greater TU43 parity. + - Fixed zombie villagers despawning beneath igloos. + - Fixed servers not dropping mob loot. + - Fixed missing localization for TU43 blocks. + - Cooked rabbit can now be obtained through normal gameplay. + - Fixed skins not displaying correctly in server worlds. + - Fixed newer fence and fence gate blocks not connecting correctly. + - Fixed player capes behaving incorrectly while flying in Creative Mode. + - Treasure enchantments can no longer be obtained through standard enchanting methods. + - Fixed minimap text colors and several DirectX-related rendering issues. + - Fixed underground bedrock generation creating overlapping blocks. + - Updated magma blocks and grass paths to match TU43 generation behavior. + - Fixed the Classic Crafting interface and restored its full functionality. + - Fixed a crash that could occur when players traveled beyond the world border in Spectator Mode. + - Enchanted books can now generate in the loot chests of applicable structures. + - The Sword of Debug can no longer be obtained in non-Debug builds. + - Fixed item frames and other hanging entities having an incorrect positional offset. @@ -5813,6 +5835,10 @@ Press{*CONTROLLER_VK_B*} if you already know about Fireworks. Are you sure you want to exit to the main menu? Any unsaved progress will be lost. + + Are you sure you want to exit to the main menu? + + Are you sure you want to exit to the main menu? Your progress will be lost! @@ -9534,6 +9560,9 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Plant on Farmland. Restores 3{*ICON_SHANK_01*}. + Awarded all achievements + All achievements have been awarded. + Taking Inventory Open your inventory. @@ -9700,6 +9729,10 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Swap + + Swap A & B + + Copy Save diff --git a/Minecraft.Client/Windows64Media/loc/stringsPlatformSpecific.xml b/Minecraft.Client/Windows64Media/loc/stringsPlatformSpecific.xml index d690dd11..f6b7a735 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsPlatformSpecific.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsPlatformSpecific.xml @@ -247,7 +247,21 @@ Please do not turn off your computer while this icon is on-screen. If you try to save while using the trial version, you will be given the option to purchase the full version. - + + Enable autosave + + + Would you like to enable the constant, automatic saving of the world? + + + Disable Autosave + + + Disable autosave + + + Are you sure you want to disable the constant, automatic saving of the world? + Small diff --git a/Minecraft.World/AddPaintingPacket.cpp b/Minecraft.World/AddPaintingPacket.cpp index 1b3ec14b..9e3e3c69 100644 --- a/Minecraft.World/AddPaintingPacket.cpp +++ b/Minecraft.World/AddPaintingPacket.cpp @@ -16,6 +16,7 @@ AddPaintingPacket::AddPaintingPacket() dir = 0; motive = L""; placedByPlayer = false; + placedByTutorial = false; } AddPaintingPacket::AddPaintingPacket(shared_ptr e) @@ -27,6 +28,7 @@ AddPaintingPacket::AddPaintingPacket(shared_ptr e) dir = e->dir; motive = e->motive->name; placedByPlayer = e->placedByPlayer; + placedByTutorial = e->placedByTutorial; } void AddPaintingPacket::read(DataInputStream *dis) //throws IOException @@ -38,6 +40,7 @@ void AddPaintingPacket::read(DataInputStream *dis) //throws IOException z = dis->readInt(); dir = dis->readInt(); placedByPlayer = dis->readByte() != 0; + placedByTutorial = dis->readByte() != 0; } void AddPaintingPacket::write(DataOutputStream *dos) //throws IOException @@ -49,6 +52,7 @@ void AddPaintingPacket::write(DataOutputStream *dos) //throws IOException dos->writeInt(z); dos->writeInt(dir); dos->writeByte(placedByPlayer ? 1 : 0); + dos->writeByte(placedByTutorial ? 1 : 0); } void AddPaintingPacket::handle(PacketListener *listener) diff --git a/Minecraft.World/AddPaintingPacket.h b/Minecraft.World/AddPaintingPacket.h index e42c4863..1d6a288b 100644 --- a/Minecraft.World/AddPaintingPacket.h +++ b/Minecraft.World/AddPaintingPacket.h @@ -13,6 +13,7 @@ public: int dir; wstring motive; bool placedByPlayer; + bool placedByTutorial; public: AddPaintingPacket(); diff --git a/Minecraft.World/ArmorStand.cpp b/Minecraft.World/ArmorStand.cpp index 81f6beca..38cfc8aa 100644 --- a/Minecraft.World/ArmorStand.cpp +++ b/Minecraft.World/ArmorStand.cpp @@ -16,6 +16,7 @@ #include "ParticleTypes.h" #include "Random.h" #include "AABB.h" +#include "SoundTypes.h" #include "../Minecraft.World/LevelChunk.h" const Rotations ArmorStand::DEFAULT_HEAD_POSE (0.0f, 0.0f, 0.0f); @@ -386,6 +387,7 @@ bool ArmorStand::hurt(DamageSource* source, float damage) if (source->isExplosion()) { + playSound(eSoundType_ENTITY_ARMORSTAND_BREAK, 1.0f, 1.0f); spawnAtLocation(Item::armor_stand_Id, 1); brokenByAnything(); remove(); @@ -398,6 +400,7 @@ bool ArmorStand::hurt(DamageSource* source, float damage) if (attacker && attacker->instanceof(eTYPE_PLAYER) && dynamic_pointer_cast(attacker)->abilities.instabuild) { + playSound(eSoundType_ENTITY_ARMORSTAND_BREAK, 1.0f, 1.0f); level->broadcastEntityEvent(shared_from_this(), (byte)31); remove(); return true; @@ -417,6 +420,7 @@ bool ArmorStand::hurt(DamageSource* source, float damage) return false; } + playSound(eSoundType_ENTITY_ARMORSTAND_HIT, 1.0f, 1.0f); hurtDir = -hurtDir; standDamage += damage * 10.0f; lastHit = (long long)tickCount; @@ -424,6 +428,7 @@ bool ArmorStand::hurt(DamageSource* source, float damage) if (standDamage >= 40.0f) { + playSound(eSoundType_ENTITY_ARMORSTAND_BREAK, 1.0f, 1.0f); spawnAtLocation(Item::armor_stand_Id, 1); brokenByAnything(); remove(); diff --git a/Minecraft.World/BaseMobSpawner.cpp b/Minecraft.World/BaseMobSpawner.cpp index b01aeb09..723bf5e5 100644 --- a/Minecraft.World/BaseMobSpawner.cpp +++ b/Minecraft.World/BaseMobSpawner.cpp @@ -131,6 +131,8 @@ void BaseMobSpawner::tick() shared_ptr BaseMobSpawner::loadDataAndAddEntity(shared_ptr entity) { + if (entity == nullptr) return nullptr; + if (getNextSpawnData() != nullptr) { CompoundTag *data = new CompoundTag(); @@ -155,6 +157,7 @@ shared_ptr BaseMobSpawner::loadDataAndAddEntity(shared_ptr entit { CompoundTag *ridingTag = data->getCompound(Entity::RIDING_TAG); shared_ptr mount = EntityIO::newEntity(ridingTag->getString(L"id"), entity->level); + if (mount != nullptr) { CompoundTag *mountData = new CompoundTag(); @@ -230,7 +233,8 @@ void BaseMobSpawner::load(CompoundTag *tag) if (tag->contains(L"SpawnData")) { - setNextSpawnData(new SpawnData(tag->getCompound(L"SpawnData"), entityId)); + CompoundTag *spawnDataTag = tag->getCompound(L"SpawnData"); + setNextSpawnData(new SpawnData(spawnDataTag, entityId)); } else { @@ -250,7 +254,10 @@ void BaseMobSpawner::load(CompoundTag *tag) requiredPlayerRange = tag->getShort(L"RequiredPlayerRange"); } - if (tag->contains(L"SpawnRange")) spawnRange = tag->getShort(L"SpawnRange"); + if (tag->contains(L"SpawnRange")) + { + spawnRange = tag->getShort(L"SpawnRange"); + } if (getLevel() != nullptr && getLevel()->isClientSide) { @@ -328,8 +335,21 @@ void BaseMobSpawner::setNextSpawnData(SpawnData *nextSpawnData) BaseMobSpawner::SpawnData::SpawnData(CompoundTag *base) : WeighedRandomItem(base->getInt(L"Weight")) { - CompoundTag *tag = base->getCompound(L"Properties"); - wstring _type = base->getString(L"Type"); + CompoundTag *tag = nullptr; + wstring _type; + + if (!base->contains(L"Entity")) + { + CompoundTag *propertiesTag = base->getCompound(L"Properties"); + tag = propertiesTag != nullptr ? static_cast(propertiesTag->copy()) : nullptr; + _type = base->getString(L"Type"); + } + else + { + CompoundTag *entityTag = base->getCompound(L"Entity"); + tag = entityTag != nullptr ? static_cast(entityTag->copy()) : nullptr; + _type = entityTag != nullptr ? entityTag->getString(L"id") : L""; + } if (_type.compare(L"Minecart") == 0) { @@ -360,6 +380,11 @@ BaseMobSpawner::SpawnData::SpawnData(CompoundTag *base) : WeighedRandomItem(base BaseMobSpawner::SpawnData::SpawnData(CompoundTag *tag, wstring _type) : WeighedRandomItem(1) { + if (_type.empty() && tag != nullptr && tag->contains(L"id")) + { + _type = tag->getString(L"id"); + } + if (_type.compare(L"Minecart") == 0) { if (tag != nullptr) @@ -383,7 +408,7 @@ BaseMobSpawner::SpawnData::SpawnData(CompoundTag *tag, wstring _type) : WeighedR } } - this->tag = tag; + this->tag = tag != nullptr ? static_cast(tag->copy()) : nullptr; this->type = _type; } @@ -396,9 +421,9 @@ CompoundTag *BaseMobSpawner::SpawnData::save() { CompoundTag *result = new CompoundTag(); - result->putCompound(L"Properties", tag); + result->putCompound(L"Properties", tag != nullptr ? static_cast(tag->copy()) : nullptr); result->putString(L"Type", type); result->putInt(L"Weight", randomWeight); return result; -} \ No newline at end of file +} diff --git a/Minecraft.World/Cow.cpp b/Minecraft.World/Cow.cpp index 5232a3fb..6c0d4e84 100644 --- a/Minecraft.World/Cow.cpp +++ b/Minecraft.World/Cow.cpp @@ -13,6 +13,7 @@ #include "Cow.h" #include "../Minecraft.Client/Textures.h" #include "MobCategory.h" +#include "SoundTypes.h" @@ -111,6 +112,7 @@ bool Cow::mobInteract(shared_ptr player) if (item != nullptr && item->id == Item::bucket->id && !player->abilities.instabuild) { player->awardStat(GenericStats::cowsMilked(),GenericStats::param_cowsMilked()); + playSound(eSoundType_ENTITY_COW_MILK, 1.0f, 1.0f); if (item->count-- == 0) { diff --git a/Minecraft.World/Entity.cpp b/Minecraft.World/Entity.cpp index 7d3d5820..f47bf644 100644 --- a/Minecraft.World/Entity.cpp +++ b/Minecraft.World/Entity.cpp @@ -898,17 +898,15 @@ void Entity::move(double xa, double ya, double za, bool noEntityCubes) // 4J - checkFallDamage(ya, onGround); if (xaOrg != xa) xd = 0; - if (yaOrg != ya) { - // Fireblade - updated logic here cause previous check completely broke head hitter logic - bool isSlimeBlock = false; - if (level != nullptr) { - int blockBelowX = Mth::floor(x); - int blockBelowY = Mth::floor(y - 0.1f - heightOffset); - int blockBelowZ = Mth::floor(z); - int blockId = level->getTile(blockBelowX, blockBelowY, blockBelowZ); - isSlimeBlock = (blockId == Tile::slimeBlock->id); - } - if (!isSlimeBlock) { + if (yaOrg != ya) + { + int xt = Mth::floor(x); + int yt = Mth::floor(y - 0.2f - heightOffset); + int zt = Mth::floor(z); + Tile *tile = Tile::tiles[level->getTile(xt, yt, zt)]; + if (tile != nullptr) { + tile->updateEntityAfterFallOn(level, self); + } else { yd = 0; } } @@ -1117,6 +1115,10 @@ void Entity::causeFallDamage(float distance) if (rider.lock() != nullptr) rider.lock()->causeFallDamage(distance); } +void Entity::causeFallDamage(float distance, float multiplier) +{ + if (rider.lock() != nullptr) rider.lock()->causeFallDamage(distance, multiplier); +} bool Entity::isInWaterOrRain() { diff --git a/Minecraft.World/Entity.h b/Minecraft.World/Entity.h index 93b68713..3457f217 100644 --- a/Minecraft.World/Entity.h +++ b/Minecraft.World/Entity.h @@ -256,6 +256,7 @@ protected: public: bool isFireImmune(); void clearFallDamageQueue(); + virtual void causeFallDamage(float distance, float multiplier); // from decomp protected: virtual void causeFallDamage(float distance); @@ -303,9 +304,9 @@ public: protected: virtual bool repositionEntityAfterLoad(); - const wstring getEncodeId(); public: + const wstring getEncodeId(); virtual void readAdditionalSaveData(CompoundTag *tag) = 0; virtual void addAdditonalSaveData(CompoundTag *tag) = 0; /** diff --git a/Minecraft.World/EntityHorse.cpp b/Minecraft.World/EntityHorse.cpp index 949fd455..fade0fd1 100644 --- a/Minecraft.World/EntityHorse.cpp +++ b/Minecraft.World/EntityHorse.cpp @@ -405,7 +405,7 @@ void EntityHorse::dropBags() void EntityHorse::eatingHorse() { openMouth(); - level->playEntitySound(shared_from_this(), eSoundType_EATING, 1.0f, 1.0f + (random->nextFloat() - random->nextFloat()) * 0.2f); + level->playEntitySound(shared_from_this(), eSoundType_ENTITY_HORSE_EAT, 1.0f, 1.0f + (random->nextFloat() - random->nextFloat()) * 0.2f); } /** diff --git a/Minecraft.World/HangingEntity.cpp b/Minecraft.World/HangingEntity.cpp index 16649396..25d3c697 100644 --- a/Minecraft.World/HangingEntity.cpp +++ b/Minecraft.World/HangingEntity.cpp @@ -9,6 +9,12 @@ #include "../Minecraft.Client/Minecraft.h" #include "Level.h" +const int HangingEntity::kApplicableDLCIds[] = +{ + // 1030, + 1034, +}; + void HangingEntity::_init(Level *level) { checkInterval = 0; @@ -16,6 +22,7 @@ void HangingEntity::_init(Level *level) xTile = yTile = zTile = 0; this->heightOffset = 0; this->setSize(0.5f, 0.5f); + placedByTutorial = false; } HangingEntity::HangingEntity(Level *level) : Entity( level ) @@ -69,7 +76,7 @@ void HangingEntity::setDir(int dir) int offset = 0; // set offset to 1 if placed in stock world - if (level->isClientSide && !placedByPlayer) + if (level->isClientSide && placedByTutorial) { offset = 1; } @@ -262,6 +269,7 @@ void HangingEntity::push(double xa, double ya, double za) void HangingEntity::addAdditonalSaveData(CompoundTag *tag) { tag->putByte(L"PlacedByPlayer", placedByPlayer ? 1 : 0); + tag->putByte(L"PlacedByTutorial", placedByTutorial ? 1 : 0); tag->putByte(L"Direction", static_cast(dir)); tag->putInt(L"TileX", xTile); tag->putInt(L"TileY", yTile); @@ -301,6 +309,43 @@ void HangingEntity::readAdditionalSaveData(CompoundTag *tag) placedByPlayer = tag->getByte(L"PlacedByPlayer") == 1; } + if (tag->contains(L"PlacedByTutorial")) + { + placedByTutorial = tag->getByte(L"PlacedByTutorial") == 1; + } + else + { + bool isValidDLC = false; + bool isTutorial = false; + Minecraft *minecraft = Minecraft::GetInstance(); + + if (minecraft != nullptr && minecraft->isTutorial()) + { + isTutorial = true; + } + + LevelGenerationOptions *levelGen = app.getLevelGenerationOptions(); + + if (levelGen != nullptr) + { + if (levelGen->isTutorial()) + isTutorial = true; + + if (levelGen->isFromDLC()) + { + if (IsApplicableDLC(levelGen->getRequiredTexturePackId())) + { + isValidDLC = true; + } + } + } + + if ((isTutorial || isValidDLC) && !placedByPlayer) + { + placedByTutorial = true; + } + } + bool hasDir = false; if (tag->contains(L"Direction")) { diff --git a/Minecraft.World/HangingEntity.h b/Minecraft.World/HangingEntity.h index e6aa8c8d..518758e4 100644 --- a/Minecraft.World/HangingEntity.h +++ b/Minecraft.World/HangingEntity.h @@ -13,6 +13,17 @@ private: int checkInterval; //eINSTANCEOF eType; + static const int kApplicableDLCIds[1]; + inline bool IsApplicableDLC(int id) + { + for (int i = 0; i < sizeof(kApplicableDLCIds) / sizeof(kApplicableDLCIds[0]); ++i) + { + if (kApplicableDLCIds[i] == id) + return true; + } + + return false; + } protected: virtual void defineSynchedData() {}; @@ -21,6 +32,7 @@ public: int dir; int xTile, yTile, zTile; bool placedByPlayer = false; + bool placedByTutorial = false; HangingEntity(Level *level); HangingEntity(Level *level, int xTile, int yTile, int zTile, int dir); diff --git a/Minecraft.World/HangingEntityItem.cpp b/Minecraft.World/HangingEntityItem.cpp index ddb09497..6a837ad5 100644 --- a/Minecraft.World/HangingEntityItem.cpp +++ b/Minecraft.World/HangingEntityItem.cpp @@ -10,6 +10,7 @@ #include "Painting.h" #include "GenericStats.h" #include "ItemFrame.h" +#include "SoundTypes.h" HangingEntityItem::HangingEntityItem(int id, eINSTANCEOF eClassType) : Item(id) @@ -41,6 +42,11 @@ bool HangingEntityItem::useOn(shared_ptr instance, shared_ptraddEntity(entity)==TRUE) { + if (eType==eTYPE_ITEM_FRAME) + { + entity->playSound(eSoundType_ENTITY_ITEMFRAME_PLACE, 1.0f, 1.0f); + } + // 4J-JEV: Hook for durango 'BlockPlaced' event. if (eType==eTYPE_PAINTING) player->awardStat(GenericStats::blocksPlaced(Item::painting_Id), GenericStats::param_blocksPlaced(Item::painting_Id,instance->getAuxValue(),1)); else if (eType==eTYPE_ITEM_FRAME) player->awardStat(GenericStats::blocksPlaced(Item::item_frame_Id), GenericStats::param_blocksPlaced(Item::item_frame_Id,instance->getAuxValue(),1)); @@ -68,6 +74,7 @@ shared_ptr HangingEntityItem::createEntity(Level *level, int x, i { shared_ptr painting = std::make_shared(level, x, y, z, dir); painting->placedByPlayer = true; + painting->placedByTutorial = false; #ifndef _CONTENT_PACKAGE if (app.DebugArtToolsOn() && auxValue > 0) @@ -86,6 +93,7 @@ shared_ptr HangingEntityItem::createEntity(Level *level, int x, i { shared_ptr itemFrame = std::make_shared(level, x, y, z, dir); itemFrame->placedByPlayer = true; + itemFrame->placedByTutorial = false; itemFrame->setDir(dir); return dynamic_pointer_cast (itemFrame); diff --git a/Minecraft.World/ItemFrame.cpp b/Minecraft.World/ItemFrame.cpp index 528c0711..ea64d059 100644 --- a/Minecraft.World/ItemFrame.cpp +++ b/Minecraft.World/ItemFrame.cpp @@ -12,6 +12,7 @@ #include "ItemFrame.h" #include "DamageSource.h" #include "Level.h" +#include "SoundTypes.h" @@ -174,6 +175,7 @@ bool ItemFrame::interact(shared_ptr player) if (!level->isClientSide)//isClientSide) { setItem(item); + playSound(eSoundType_ENTITY_ITEMFRAME_ADD_ITEM, 1.0f, 1.0f); if (!player->abilities.instabuild) { @@ -190,6 +192,7 @@ bool ItemFrame::interact(shared_ptr player) if (!level->isClientSide)//isClientSide) { setRotation(getRotation() + 1); + playSound(eSoundType_ENTITY_ITEMFRAME_ROTATE_ITEM, 1.0f, 1.0f); } } @@ -226,11 +229,13 @@ bool ItemFrame::hurt(DamageSource *source, float damage) removeFramedMap(copy); spawnAtLocation(copy, 0); } - + + playSound(eSoundType_ENTITY_ITEMFRAME_REMOVE_ITEM, 1.0f, 1.0f); setItem(nullptr); return true; } - + + playSound(eSoundType_ENTITY_ITEMFRAME_BREAK, 1.0f, 1.0f); return HangingEntity::hurt(source, damage); } diff --git a/Minecraft.World/LeashFenceKnotEntity.cpp b/Minecraft.World/LeashFenceKnotEntity.cpp index f94bcba7..5aa0408f 100644 --- a/Minecraft.World/LeashFenceKnotEntity.cpp +++ b/Minecraft.World/LeashFenceKnotEntity.cpp @@ -4,6 +4,7 @@ #include "net.minecraft.world.level.h" #include "net.minecraft.world.phys.h" #include "LeashFenceKnotEntity.h" +#include "SoundTypes.h" void LeashFenceKnotEntity::_init() { @@ -92,8 +93,13 @@ bool LeashFenceKnotEntity::interact(shared_ptr player) } } } + if (!level->isClientSide && attachedMob) + { + playSound(eSoundType_ENTITY_LEASHKNOT_PLACE, 1.0f, 1.0f); + } if (!level->isClientSide && !attachedMob) { + playSound(eSoundType_ENTITY_LEASHKNOT_BREAK, 1.0f, 1.0f); remove(); if (player->abilities.instabuild) @@ -129,6 +135,13 @@ bool LeashFenceKnotEntity::survives() return false; } +bool LeashFenceKnotEntity::hurt(DamageSource *source, float damage) +{ + if (level->isClientSide) return false; + playSound(eSoundType_ENTITY_LEASHKNOT_BREAK, 1.0f, 1.0f); + return HangingEntity::hurt(source, damage); +} + shared_ptr LeashFenceKnotEntity::createAndAddKnot(Level *level, int x, int y, int z) { shared_ptr knot = std::make_shared(level, x, y, z); diff --git a/Minecraft.World/LeashFenceKnotEntity.h b/Minecraft.World/LeashFenceKnotEntity.h index 1bf3a7b7..3838cb78 100644 --- a/Minecraft.World/LeashFenceKnotEntity.h +++ b/Minecraft.World/LeashFenceKnotEntity.h @@ -30,6 +30,7 @@ public: void addAdditonalSaveData(CompoundTag *tag); void readAdditionalSaveData(CompoundTag *tag); bool interact(shared_ptr player); + virtual bool hurt(DamageSource *source, float damage); virtual bool survives(); static shared_ptr createAndAddKnot(Level *level, int x, int y, int z); static shared_ptr findKnotAt(Level *level, int x, int y, int z); diff --git a/Minecraft.World/LeashItem.cpp b/Minecraft.World/LeashItem.cpp index 4de74a5c..036b6f2b 100644 --- a/Minecraft.World/LeashItem.cpp +++ b/Minecraft.World/LeashItem.cpp @@ -34,6 +34,7 @@ bool LeashItem::bindPlayerMobs(shared_ptr player, Level *level, int x, i // look for entities that can be attached to the fence bool foundMobs = false; + bool knotCreated = false; double range = 7; vector > *mobs = level->getEntitiesOfClass(typeid(Mob), AABB::newTemp(x - range, y - range, z - range, x + range, y + range, z + range)); if (mobs != nullptr) @@ -46,12 +47,19 @@ bool LeashItem::bindPlayerMobs(shared_ptr player, Level *level, int x, i if (activeKnot == nullptr) { activeKnot = LeashFenceKnotEntity::createAndAddKnot(level, x, y, z); + knotCreated = true; } mob->setLeashedTo(activeKnot, true); foundMobs = true; } } } + + if (foundMobs && knotCreated) + { + activeKnot->playSound(eSoundType_ENTITY_LEASHKNOT_PLACE, 1.0f, 1.0f); + } + return foundMobs; } diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index 798a45f7..2d6f1210 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -160,39 +160,77 @@ void LivingEntity::registerAttributes() void LivingEntity::checkFallDamage(double ya, bool onGround) { - if (!isInWater()) - { - // double-check if we've reached water in this move tick - updateInWaterState(); - } + if (!isInWater()) + { + // double-check if we've reached water in this move tick + updateInWaterState(); + } - if (onGround) - { - int xt = Mth::floor(x); - int yt = Mth::floor(y - 0.2f - heightOffset); - int zt = Mth::floor(z); - int t = level->getTile(xt, yt, zt); - if (t == 0) - { - int renderShape = level->getTileRenderShape(xt, yt - 1, zt); - if (renderShape == Tile::SHAPE_FENCE || renderShape == Tile::SHAPE_WALL || renderShape == Tile::SHAPE_FENCE_GATE) - { - t = level->getTile(xt, yt - 1, zt); - } - } + if (onGround) + { + int xt = Mth::floor(x); + int yt = Mth::floor(y - 0.2f - heightOffset); + int zt = Mth::floor(z); + int t = level->getTile(xt, yt, zt); + if (t == 0) + { + int renderShape = level->getTileRenderShape(xt, yt - 1, zt); + if (renderShape == Tile::SHAPE_FENCE || renderShape == Tile::SHAPE_WALL || renderShape == Tile::SHAPE_FENCE_GATE) + { + t = level->getTile(xt, yt - 1, zt); + } + } - Tile *tile = Tile::tiles[t]; - if (t > 0 && tile != nullptr) // tu31 tutorial world fix - { - if (fallDistance > 0 || t == Tile::slimeBlock->id) - { - auto ent = shared_from_this(); - Tile::tiles[t]->fallOn(level, xt, yt, zt, ent, fallDistance); - } - } - } + Tile *tile = Tile::tiles[t]; + if (t > 0 && tile != nullptr) // tu31 tutorial world fix + { + if (fallDistance > 0 || t == Tile::slimeBlock->id) + { + auto ent = shared_from_this(); + Tile::tiles[t]->fallOn(level, xt, yt, zt, ent, fallDistance); + if (t == Tile::slimeBlock->id && !isSneaking()) + { + m_clearFallDamageThisTick = true; + } + } + } - Entity::checkFallDamage(ya, onGround); + // landing particles + if (!level->isClientSide && fallDistance > 3.0f) + { + Material* material = level->getMaterial(xt, yt, zt); + if (material != Material::air) + { + float adjusted = ceilf(fallDistance - 3.0f); + float scaled = (adjusted / 15.0f) + 0.2f; + + float speed = 10.0f; + if (scaled < 10.0f) speed = scaled; + if (speed > 2.5f) speed = 2.5f; + + int particleCount = (int)(speed * 150.0f); + int blockIdWithData = t | (level->getData(xt, yt, zt) << Tile::TILE_NUM_SHIFT); + arrayWithLength extraData(1, false); + extraData[0] = blockIdWithData; + ServerLevel *serverLevel = dynamic_cast(level); + + if (serverLevel != nullptr) + { + serverLevel->sendParticles( + ParticleType::blockdust, + false, + x, y, z, + particleCount, + 0, 0, 0, + 0.15, + extraData + ); + } + } + } + } + + Entity::checkFallDamage(ya, onGround); } bool LivingEntity::isWaterMob() @@ -213,7 +251,8 @@ void LivingEntity::baseTick() if (!level->isClientSide && isAlive() && onGround && !isSneaking() && tickCount % 10 == 0) { int tileBelow = level->getTile(Mth::floor(x), Mth::floor(bb->y0) - 1, Mth::floor(z)); - if (tileBelow == Tile::magma_block_Id) + bool hasFrostWalker = EnchantmentHelper::getEnchantmentLevel(Enchantment::frostWalker->id, getEquipmentSlots()) > 0; + if (tileBelow == Tile::magma_block_Id && !hasFrostWalker) { hurt(DamageSource::hotFloor, 1); } diff --git a/Minecraft.World/LootTableManager.cpp b/Minecraft.World/LootTableManager.cpp index c9d008f6..1a592f8b 100644 --- a/Minecraft.World/LootTableManager.cpp +++ b/Minecraft.World/LootTableManager.cpp @@ -174,7 +174,8 @@ int ResolveSmeltedItemId(const std::string &itemName, int currentItemId) else if (normalized == "beef" || normalized == "porkchop" || normalized == "chicken" - || normalized == "mutton") + || normalized == "mutton" + || normalized == "rabbit") { return GetItemIdByName("cooked_" + normalized); } @@ -1086,7 +1087,8 @@ std::vector LootTableManager::ResolveDrops( } else if (functionIt->functionName == "enchant_randomly") { - LootLog("[LootDbg] enchant_randomly -> deferred to enchantment system\n"); + result.enchantLevels = 1 + randomInt(30); + LootLog("[LootDbg] enchant_randomly -> levels=%d\n", result.enchantLevels); } } diff --git a/Minecraft.World/Painting.cpp b/Minecraft.World/Painting.cpp index 5e56b9ca..29334cee 100644 --- a/Minecraft.World/Painting.cpp +++ b/Minecraft.World/Painting.cpp @@ -8,6 +8,7 @@ #include "com.mojang.nbt.h" #include "Painting.h" #include "Material.h" +#include "SoundTypes.h" @@ -101,6 +102,7 @@ void Painting::PaintingPostConstructor(int dir, int motive) this->motive = survivableMotives->at(random->nextInt(static_cast(survivableMotives->size()))); } setDir(dir); + playSound(eSoundType_ENTITY_PAINTING_PLACE, 1.0f, 1.0f); } } @@ -165,4 +167,11 @@ void Painting::dropItem(shared_ptr causedBy) } spawnAtLocation(std::make_shared(Item::painting), 0.0f); -} \ No newline at end of file +} + +bool Painting::hurt(DamageSource *source, float damage) +{ + if (level->isClientSide) return false; + playSound(eSoundType_ENTITY_PAINTING_BREAK, 1.0f, 1.0f); + return HangingEntity::hurt(source, damage); +} diff --git a/Minecraft.World/Painting.h b/Minecraft.World/Painting.h index b47a012b..a0b08f35 100644 --- a/Minecraft.World/Painting.h +++ b/Minecraft.World/Painting.h @@ -100,7 +100,7 @@ public: //virtual void tick(); //bool survives(); //virtual bool isPickable(); - //virtual bool hurt(DamageSource *source, int damage); + virtual bool hurt(DamageSource *source, float damage); virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); //static Motive *randomMotive(); diff --git a/Minecraft.World/ParticleTypes.h b/Minecraft.World/ParticleTypes.h index 130d5cdb..4d3e939f 100644 --- a/Minecraft.World/ParticleTypes.h +++ b/Minecraft.World/ParticleTypes.h @@ -49,13 +49,16 @@ enum ePARTICLE_TYPE eParticleType_iconcrack_last = 0x1FFFFF, eParticleType_tilecrack_base = 0x200000, // There's a range of tilecrack particle types based on tile id and data. eParticleType_tilecrack_last = 0x2FFFFF, - // 0x0000FF, <- these bits are for storing the data value. - // 0x0FFF00, <- these bits are for encoding tile/item id. - // 0x300000, <- these bits show if its an icon/tile or not. + eParticleType_blockdust_base = 0x300000, + eParticleType_blockdust_last = 0x3FFFFF, + // 0x0000FF, <- these bits are for storing the data value. + // 0x0FFF00, <- these bits are for encoding tile/item id. + // 0x300000, <- these bits show if its an icon/tile or not. }; #define PARTICLE_TILECRACK(id,data) ( (ePARTICLE_TYPE) ( ((int) eParticleType_tilecrack_base) | ((0x0FFF & id) << 8) | (0x0FF & data)) ) +#define PARTICLE_BLOCKDUST(id,data) ( (ePARTICLE_TYPE) ( ((int) eParticleType_blockdust_base) | ((0x0FFF & id) << 8) | (0x0FF & data)) ) #define PARTICLE_ICONCRACK(id,data) ( (ePARTICLE_TYPE) ( ((int) eParticleType_iconcrack_base) | ((0x0FFF & id) << 8) | (0x0FF & data)) ) #define PARTICLE_CRACK_ID(ePType) ((0x0FFF00 & (int)ePType) >> 8) diff --git a/Minecraft.World/SlimeTile.cpp b/Minecraft.World/SlimeTile.cpp index b7a9b0d6..cba8338b 100644 --- a/Minecraft.World/SlimeTile.cpp +++ b/Minecraft.World/SlimeTile.cpp @@ -40,54 +40,59 @@ int SlimeTile::getPistonPushReaction() void SlimeTile::fallOn(Level *level, int x, int y, int z, shared_ptr entity, float distance) { - HalfTransparentTile::fallOn(level, x, y, z, entity, distance); + assert(entity != nullptr); - if (entity == nullptr) - return; + bool sneaking = entity->isSneaking(); - entity->clearFallDamageQueue(); - - entity->fallDistance = 0.0f; - - if (entity->isSneaking() || std::abs(entity->yd) < 0.1f) + if (!sneaking) { - entity->yd = 0.0f; - return; + entity->causeFallDamage(distance, 0.0f); // no damage } - - if (entity->yd < 0.0f) + else { - entity->yd = -entity->yd; - - if (!(entity->instanceof(eTYPE_LIVINGENTITY))) - { - entity->yd *= 0.8f; - } + Tile::fallOn(level, x, y, z, entity, distance); // normal fall damage } } void SlimeTile::stepOn(Level *level, int x, int y, int z, shared_ptr entity) { - if (entity != nullptr) - { - entity->clearFallDamageQueue(); + assert(entity != nullptr); + + if ((std::abs)(entity->yd) < 0.1) { + bool sneaking = entity->isSneaking(); + + if (!sneaking) { + double factor = (std::abs)(entity->yd) * 0.2 + 0.4; + + entity->xd *= factor; + entity->zd *= factor; + } } - if (entity != nullptr && - std::abs(entity->yd) < 0.1f && - !entity->isSneaking()) - { - double d0 = 0.4 + std::abs(entity->yd) * 0.2; - - entity->xd *= d0; - entity->zd *= d0; - level->playSound(x + 0.5, y + 0.5, z + 0.5, eSoundType_MOB_SLIME_SMALL, 0.4f, 0.8f + level->random->nextFloat() * 0.4f); - } - - HalfTransparentTile::stepOn(level, x, y, z, entity); + Tile::stepOn(level, x, y, z, entity); } void SlimeTile::updateEntityAfterFallOn(Level* level, shared_ptr entity) { - // stub + assert(entity != nullptr); + + bool sneaking = entity->isSneaking(); + + if (!sneaking) { + if (!(entity->yd > -0.08 && entity->yd < 0.0)) + { + if (entity->yd < 0.0) + { + entity->yd = -entity->yd; // bounce + } + } + else + { + Tile::updateEntityAfterFallOn(level, entity); // LAB_02a7a4e4 goto + } + } + else + { + Tile::updateEntityAfterFallOn(level, entity); // LAB_02a7a4e4 definition + } } diff --git a/Minecraft.World/SnowMan.cpp b/Minecraft.World/SnowMan.cpp index 5b178676..99ca5df3 100644 --- a/Minecraft.World/SnowMan.cpp +++ b/Minecraft.World/SnowMan.cpp @@ -83,6 +83,16 @@ void SnowMan::aiStep() } } +int SnowMan::getHurtSound() +{ + return eSoundType_ENTITY_SNOWMAN_HURT; +} + +int SnowMan::getDeathSound() +{ + return eSoundType_ENTITY_SNOWMAN_DEATH; +} + int SnowMan::getDeathLoot() { return Item::snowball_Id; diff --git a/Minecraft.World/SnowMan.h b/Minecraft.World/SnowMan.h index ff473432..756cb142 100644 --- a/Minecraft.World/SnowMan.h +++ b/Minecraft.World/SnowMan.h @@ -20,6 +20,8 @@ public: virtual void aiStep(); protected: + virtual int getHurtSound(); + virtual int getDeathSound(); virtual int getDeathLoot(); // virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); diff --git a/Minecraft.World/SoundTypes.h b/Minecraft.World/SoundTypes.h index 131760c4..75d98f73 100644 --- a/Minecraft.World/SoundTypes.h +++ b/Minecraft.World/SoundTypes.h @@ -283,6 +283,47 @@ enum eSOUND_TYPE eSoundType_MOB_POLARBEAR_STEP, eSoundType_MOB_POLARBEAR_WARNING, + // tu43 + // witch sounds + eSoundType_ENTITY_WITCH_AMBIENT, + eSoundType_ENTITY_WITCH_HURT, + eSoundType_ENTITY_WITCH_DEATH, + eSoundType_ENTITY_WITCH_THROW, + + // squid sounds + eSoundType_ENTITY_SQUID_AMBIENT, + eSoundType_ENTITY_SQUID_HURT, + eSoundType_ENTITY_SQUID_DEATH, + + // snowman sounds + eSoundType_ENTITY_SNOWMAN_HURT, + eSoundType_ENTITY_SNOWMAN_DEATH, + + // armor stand sounds + eSoundType_ENTITY_ARMORSTAND_BREAK, + eSoundType_ENTITY_ARMORSTAND_HIT, + + // cow sounds + eSoundType_ENTITY_COW_MILK, + + // horse sounds + eSoundType_ENTITY_HORSE_EAT, + + // item frame sounds + eSoundType_ENTITY_ITEMFRAME_ADD_ITEM, + eSoundType_ENTITY_ITEMFRAME_BREAK, + eSoundType_ENTITY_ITEMFRAME_PLACE, + eSoundType_ENTITY_ITEMFRAME_REMOVE_ITEM, + eSoundType_ENTITY_ITEMFRAME_ROTATE_ITEM, + + // leash sounds + eSoundType_ENTITY_LEASHKNOT_BREAK, + eSoundType_ENTITY_LEASHKNOT_PLACE, + + // painting sounds + eSoundType_ENTITY_PAINTING_PLACE, + eSoundType_ENTITY_PAINTING_BREAK, + eSoundType_MAX }; @@ -307,6 +348,7 @@ enum eMATERIALSOUND_TYPE eMaterialSoundType_WOOD, eMaterialSoundType_GRAVEL, eMaterialSoundType_GRASS, + eMaterialSoundType_SLIME, eMaterialSoundType_METAL, eMaterialSoundType_GLASS, eMaterialSoundType_CLOTH, diff --git a/Minecraft.World/Squid.cpp b/Minecraft.World/Squid.cpp index fcfbe6cb..d3ba6125 100644 --- a/Minecraft.World/Squid.cpp +++ b/Minecraft.World/Squid.cpp @@ -9,6 +9,7 @@ #include "net.minecraft.world.entity.monster.h" #include "SharedConstants.h" #include "Squid.h" +#include "SoundTypes.h" #include "../Minecraft.Client/Textures.h" void Squid::_init() @@ -48,17 +49,17 @@ void Squid::registerAttributes() int Squid::getAmbientSound() { - return -1; + return eSoundType_ENTITY_SQUID_AMBIENT; } int Squid::getHurtSound() { - return -1; + return eSoundType_ENTITY_SQUID_HURT; } int Squid::getDeathSound() { - return -1; + return eSoundType_ENTITY_SQUID_DEATH; } float Squid::getSoundVolume() diff --git a/Minecraft.World/StringHelpers.cpp b/Minecraft.World/StringHelpers.cpp index 785cb755..e15a0939 100644 --- a/Minecraft.World/StringHelpers.cpp +++ b/Minecraft.World/StringHelpers.cpp @@ -70,40 +70,76 @@ wstring convStringToWstring(const string& converting) // to save having to clear it up everywhere this is used. const char *wstringtofilename(const wstring& name) { - static std::string buf; - buf.clear(); - buf.reserve(name.length()); - for(unsigned int i = 0; i < name.length(); i++ ) - { - wchar_t c = name[i]; -#if defined __PS3__ || defined __ORBIS__ - if(c=='\\') c='/'; -#else - if(c=='/') c='\\'; + static thread_local char buf[4][8192]; + static thread_local int bufIndex = 0; + + char *out = buf[bufIndex]; + bufIndex = (bufIndex + 1) % 4; + + size_t len = name.length(); + if (len >= sizeof(buf[0])) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("wstringtofilename: path too long, truncating from %zu to %zu\n", len, sizeof(buf[0]) - 1); #endif - // assert(c<128); // Will we have to do any conversion of non-ASCII characters in filenames? - if (c >= 128) { - printf("Non-ASCII character in filename: %lc\n", c); - c = '?'; - } - // buf[i] = static_cast(c); does nothing - buf.push_back(static_cast(c)); - } - return buf.c_str(); + len = sizeof(buf[0]) - 1; + } + + for (size_t i = 0; i < len; ++i) + { + wchar_t c = name[i]; +#if defined __PS3__ || defined __ORBIS__ + if (c == L'\\') c = L'/'; +#else + if (c == L'/') c = L'\\'; +#endif + if (c >= 128) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("Non-ASCII character in filename: %lc\n", c); +#endif + c = L'?'; + } + out[i] = static_cast(c); + } + out[len] = '\0'; + + return out; } const char *wstringtochararray(const wstring& name) { - static std::string buf; - buf.clear(); - buf.reserve(name.length()); - for(unsigned int i = 0; i < name.length(); i++ ) - { - wchar_t c = name[i]; - assert(c<128); // Will we have to do any conversion of non-ASCII characters in filenames? - buf.push_back(static_cast(c)); - } - return buf.c_str(); + static thread_local char buf[4][8192]; + static thread_local int bufIndex = 0; + + char *out = buf[bufIndex]; + bufIndex = (bufIndex + 1) % 4; + + size_t len = name.length(); + if (len >= sizeof(buf[0])) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("wstringtochararray: string too long, truncating from %zu to %zu\n", len, sizeof(buf[0]) - 1); +#endif + len = sizeof(buf[0]) - 1; + } + + for (size_t i = 0; i < len; ++i) + { + wchar_t c = name[i]; + if (c >= 128) + { +#ifndef _CONTENT_PACKAGE + app.DebugPrintf("Non-ASCII character in string conversion: %lc\n", c); +#endif + c = L'?'; + } + out[i] = static_cast(c); + } + out[len] = '\0'; + + return out; + } wstring filenametowstring(const char *name) diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index eed25a61..1206e8e7 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -370,7 +370,7 @@ void Tile::staticCtor() Tile::SOUND_GRAVEL = new Tile::SoundType(eMaterialSoundType_GRAVEL, 1, 1); Tile::SOUND_GRASS = new Tile::SoundType(eMaterialSoundType_GRASS, 1, 1); Tile::SOUND_STONE = new Tile::SoundType(eMaterialSoundType_STONE, 1, 1); - Tile::SOUND_SLIME = new Tile::SoundType(eMaterialSoundType_STONE, 1, 1, eSoundType_MOB_SLIME_BIG, eSoundType_MOB_SLIME_BIG); + Tile::SOUND_SLIME = new Tile::SoundType(eMaterialSoundType_SLIME, 1, 1, eSoundType_MOB_SLIME_BIG, eSoundType_MOB_SLIME_BIG); Tile::SOUND_METAL = new Tile::SoundType(eMaterialSoundType_STONE, 1, 1.5f); Tile::SOUND_GLASS = new Tile::SoundType(eMaterialSoundType_STONE, 1, 1, eSoundType_RANDOM_GLASS,eSoundType_STEP_STONE); Tile::SOUND_CLOTH = new Tile::SoundType(eMaterialSoundType_CLOTH, 1, 1); @@ -1642,7 +1642,7 @@ void Tile::registerIcons(IconRegister *iconRegister) void Tile::updateEntityAfterFallOn(Level *level, shared_ptr entity) { if (!entity) return; - entity->fallDistance = 0.0f; + entity->yd = 0; } wstring Tile::getTileItemIconName() @@ -1673,6 +1673,9 @@ Tile::SoundType::SoundType(eMATERIALSOUND_TYPE eMaterialSound, float volume, flo case eMaterialSoundType_GRASS: this->iBreakSound=eSoundType_DIG_GRASS; break; + case eMaterialSoundType_SLIME: + this->iStepSound=eSoundType_MOB_SLIME_SMALL; + break; case eMaterialSoundType_METAL: this->iBreakSound=eSoundType_DIG_STONE; break; @@ -1722,6 +1725,9 @@ Tile::SoundType::SoundType(eMATERIALSOUND_TYPE eMaterialSound, float volume, flo case eMaterialSoundType_GRASS: this->iStepSound=eSoundType_STEP_GRASS; break; + case eMaterialSoundType_SLIME: + this->iStepSound=eSoundType_MOB_SLIME_SMALL; + break; case eMaterialSoundType_METAL: this->iStepSound=eSoundType_STEP_METAL; break; diff --git a/Minecraft.World/WallTile.cpp b/Minecraft.World/WallTile.cpp index 9b9ff947..dc292a0f 100644 --- a/Minecraft.World/WallTile.cpp +++ b/Minecraft.World/WallTile.cpp @@ -155,7 +155,13 @@ AABB *WallTile::getAABB(Level *level, int x, int y, int z) bool WallTile::connectsTo(LevelSource *level, int x, int y, int z) { int tile = level->getTile(x, y, z); - if (tile == id || tile == Tile::fence_gate_Id) + if (tile == id || tile == Tile::fence_gate_Id || + tile == Tile::birch_fence_gate_Id || + tile == Tile::spruce_fence_gate_Id || + tile == Tile::jungle_fence_gate_Id || + tile == Tile::acacia_fence_gate_Id || + tile == Tile::dark_oak_fence_gate_Id + ) // fix: walls only connecting to the regular fence gate { return true; } diff --git a/Minecraft.World/Witch.cpp b/Minecraft.World/Witch.cpp index 053b8023..345c23b1 100644 --- a/Minecraft.World/Witch.cpp +++ b/Minecraft.World/Witch.cpp @@ -12,6 +12,7 @@ #include "net.minecraft.world.level.h" #include "net.minecraft.world.phys.h" #include "Witch.h" +#include "SoundTypes.h" AttributeModifier *Witch::SPEED_MODIFIER_DRINKING = (new AttributeModifier(eModifierId_MOB_WITCH_DRINKSPEED, -0.25f, AttributeModifier::OPERATION_ADDITION))->setSerialize(false); @@ -48,17 +49,17 @@ void Witch::defineSynchedData() int Witch::getAmbientSound() { - return eSoundType_MOB_WITCH_IDLE; //"mob.witch.idle"; + return eSoundType_ENTITY_WITCH_AMBIENT; } int Witch::getHurtSound() { - return eSoundType_MOB_WITCH_HURT; //"mob.witch.hurt"; + return eSoundType_ENTITY_WITCH_HURT; } int Witch::getDeathSound() { - return eSoundType_MOB_WITCH_DEATH; //"mob.witch.death"; + return eSoundType_ENTITY_WITCH_DEATH; } void Witch::setUsingItem(bool isUsing) @@ -211,6 +212,7 @@ void Witch::performRangedAttack(shared_ptr target, float power) } potion->shoot(xd, yd + dist * 0.2f, zd, 0.75f, 8); + playSound(eSoundType_ENTITY_WITCH_THROW, 1.0f, 1.0f); level->addEntity(potion); } \ No newline at end of file diff --git a/NOTES.md b/NOTES.md index b5bf1c44..1d18fbf8 100644 --- a/NOTES.md +++ b/NOTES.md @@ -1,30 +1,44 @@ -# neoLegacy v1.1.0b +# neoLegacy v1.1.1b ### Additions -- Release builds now feature a logging system for developer debugging. -- Spectator mode has been added into Debug builds of neoLegacy. -- Added the Mario world into the game. -- Added all the TU43-related blocks into the game. -- Igloos and Fossils can now be found throughout the game. + +- Added banner patterns. +- Added full keyboard and mouse support, including improved graphics. +- Added impact particles when players fall from significant heights. +- Added additional sounds for armor stands, cows, horses, item frames, paintings, and leads. +- Added a Passive Chunk Loading option to the Game Options menu, with improved stability on lower-end devices. +- Added support for additional languages, including Czech, Danish, Greek, Finnish, Norwegian, Polish, and more. ### Changes -- neoLegacy branding has been added on the title screen. -- Dedicated servers now feature numerous stability improvements + bugfixes. -- Cow sounds have been updated to match their TU31 counterparts. -- The neoLegacy save format is now universal, meaning that -anyone can make a DLC world purely from own unique saves. -- World generation has been updated to closely match the original Legacy Console Edition. -- Elytra has been updated with additional accuracy improvements. -- Animated textures have been updated to smoothly interpolate between frames. + +- Creepers now display an **Ignite** tooltip when the player is holding a flint and steel. +- Panorama settings are now customizable to improve DLC compatibility. +- Host Privileges are now enabled by default when creating a Creative Mode world. ### Bug Fixes -- Flower pots can now properly store all flower variants when interacted with. -- The in-game localization menu no longer crashes when switching between Japanese, Chinese, or Korean languages. -- Jukeboxes now play audio correctly, causing the in-game soundtrack to fade out before playing any music. -- The zombie villager model has been updated to match the new 64x64 skin changes. -- neoLegacy dedicated servers no longer crash due to missing color files. -roadmap +- Fixed main menu music not transitioning correctly when switching worlds. +- Fixed Debug builds on Linux not functioning correctly. +- Fixed fossils generating underwater or entirely as coal ore. +- Improved magma block generation for greater TU43 parity. +- Fixed zombie villagers despawning beneath igloos. +- Fixed servers not dropping mob loot. +- Fixed missing localization for TU43 blocks. +- Cooked rabbit can now be obtained through normal gameplay. +- Fixed skins not displaying correctly in server worlds. +- Fixed newer fence and fence gate blocks not connecting correctly. +- Fixed player capes behaving incorrectly while flying in Creative Mode. +- Treasure enchantments can no longer be obtained through standard enchanting methods. +- Fixed minimap text colors and several DirectX-related rendering issues. +- Fixed underground bedrock generation creating overlapping blocks. +- Updated magma blocks and grass paths to match TU43 generation behavior. +- Fixed the Classic Crafting interface and restored its full functionality. +- Fixed a crash that could occur when players traveled beyond the world border in Spectator Mode. +- Enchanted books can now generate in the loot chests of applicable structures. +- The Sword of Debug can no longer be obtained in non-Debug builds. +- Fixed item frames and other hanging entities having an incorrect positional offset. + +roadmap # Download -Get the latest build from [LCE Emerald Launcher](https://github.com/LCE-Hub/LCE-Emerald-Launcher/releases) or the upcoming LC Launcher. +Get the latest build(s) from the [Emerald](https://github.com/LCE-Hub/LCE-Emerald-Launcher/releases/) or [LC](https://github.com/thehuckledev/LC-Launcher/releases/) Launcher(s). diff --git a/tools/toggle_region_format_16.py b/tools/toggle_region_format_16.py new file mode 100644 index 00000000..c31cc1af --- /dev/null +++ b/tools/toggle_region_format_16.py @@ -0,0 +1,227 @@ +#!/usr/bin/env python3 + +import argparse +import os +import sys +import zlib + +FILE_ENTRY_SIZE = 144 +SAVE_HEADER_SIZE = 12 +REGION_FORMAT_16_NAME = "region_format_16" + + +def read_u16(data, offset, endian): + return int.from_bytes(data[offset:offset + 2], endian) + + +def read_u32(data, offset, endian): + return int.from_bytes(data[offset:offset + 4], endian) + + +def read_u64(data, offset, endian): + return int.from_bytes(data[offset:offset + 8], endian) + + +def write_u32(buf, offset, value, endian): + buf[offset:offset + 4] = int(value).to_bytes(4, endian, signed=False) + + +def write_u64(buf, offset, value, endian): + buf[offset:offset + 8] = int(value).to_bytes(8, endian, signed=False) + + +def detect_payload_endian(payload): + for endian in ("little", "big"): + header_offset = read_u32(payload, 0, endian) + header_count = read_u32(payload, 4, endian) + if header_offset < SAVE_HEADER_SIZE: + continue + if header_count == 0 or header_count > 50000: + continue + if header_offset + (header_count * FILE_ENTRY_SIZE) == len(payload): + return endian + return None + + +def parse_entries(payload, endian): + header_offset = read_u32(payload, 0, endian) + header_count = read_u32(payload, 4, endian) + original_version = read_u16(payload, 8, endian) + current_version = read_u16(payload, 10, endian) + + if header_offset + (header_count * FILE_ENTRY_SIZE) != len(payload): + raise ValueError("Invalid save header layout") + + entries = [] + text_encoding = "utf-16-le" if endian == "little" else "utf-16-be" + for i in range(header_count): + entry_offset = header_offset + (i * FILE_ENTRY_SIZE) + raw_name = payload[entry_offset:entry_offset + 128] + name = raw_name.decode(text_encoding, errors="ignore").split("\x00", 1)[0] + length = read_u32(payload, entry_offset + 128, endian) + start = read_u32(payload, entry_offset + 132, endian) + last_modified = read_u64(payload, entry_offset + 136, endian) + entries.append( + { + "name": name, + "length": length, + "start": start, + "last_modified": last_modified, + } + ) + + return { + "header_offset": header_offset, + "original_version": original_version, + "current_version": current_version, + "entries": entries, + } + + +def serialize_payload_from_entries(entries, original_version, current_version, endian): + data_payload = bytearray(SAVE_HEADER_SIZE) + serialized_entries = [] + + for entry in entries: + start = len(data_payload) + data = entry["data"] + data_payload.extend(data) + serialized_entries.append( + { + "name": entry["name"], + "start": start, + "length": len(data), + "last_modified": entry.get("last_modified", 0), + } + ) + + header_offset = len(data_payload) + out_payload = bytearray(data_payload) + write_u32(out_payload, 0, header_offset, endian) + write_u32(out_payload, 4, len(serialized_entries), endian) + out_payload[8:10] = int(original_version).to_bytes(2, endian, signed=False) + out_payload[10:12] = int(current_version).to_bytes(2, endian, signed=False) + + text_encoding = "utf-16-le" if endian == "little" else "utf-16-be" + header_table = bytearray() + for entry in serialized_entries: + record = bytearray(FILE_ENTRY_SIZE) + name_bytes = entry["name"].encode(text_encoding, errors="ignore") + name_bytes = name_bytes[:128] + name_bytes = name_bytes + (b"\x00" * (128 - len(name_bytes))) + record[0:128] = name_bytes + write_u32(record, 128, entry["length"], endian) + write_u32(record, 132, entry["start"], endian) + write_u64(record, 136, entry["last_modified"], endian) + header_table.extend(record) + + out_payload.extend(header_table) + return bytes(out_payload) + + +def toggle_region_format_16(input_path, output_path, source_endian="auto"): + with open(input_path, "rb") as f: + blob = f.read() + + if len(blob) < 12: + raise ValueError("Input file is too small to be a valid save file") + + compressed_payload = blob[8:] + payload = zlib.decompress(compressed_payload) + + endian = source_endian + if endian == "auto": + endian = detect_payload_endian(payload) + if endian is None: + raise ValueError("Could not detect payload endianness!") + + parsed = parse_entries(payload, endian) + + has_marker = any(e["name"] == REGION_FORMAT_16_NAME for e in parsed["entries"]) + + entries_out = [] + for e in parsed["entries"]: + if e["name"] == REGION_FORMAT_16_NAME: + continue + entries_out.append( + { + "name": e["name"], + "data": payload[e["start"]:e["start"] + e["length"]], + "last_modified": e["last_modified"], + } + ) + + if has_marker: + action = "removed" + else: + action = "added" + entries_out.append( + { + "name": REGION_FORMAT_16_NAME, + "data": b"", + "last_modified": 0, + } + ) + + out_payload = serialize_payload_from_entries( + entries_out, parsed["original_version"], parsed["current_version"], endian + ) + + out_blob = bytearray() + out_blob.extend(b"\x00\x00\x00\x00") + out_blob.extend(len(out_payload).to_bytes(4, endian, signed=False)) + out_blob.extend(zlib.compress(out_payload, level=9)) + + out_dir = os.path.dirname(output_path) + if out_dir: + os.makedirs(out_dir, exist_ok=True) + + with open(output_path, "wb") as f: + f.write(out_blob) + + return { + "action": action, + "endian": endian, + "entry_count": len(entries_out), + } + + +def main(): + parser = argparse.ArgumentParser( + description="Toggles the region_format_16 marker entry in any given mcs or ms save" + ) + parser.add_argument("input", help="Input .mcs/.ms path") + parser.add_argument( + "output", + nargs="?", + help="Output path (overwrites the input file by default)", + ) + parser.add_argument( + "--source-endian", + choices=["auto", "big", "little"], + default="auto", + help="Override the input source's endianness", + ) + + args = parser.parse_args() + output_path = args.output or args.input + + try: + result = toggle_region_format_16( + input_path=args.input, + output_path=output_path, + source_endian=args.source_endian, + ) + except Exception as exc: + print(f"Error: {exc}", file=sys.stderr) + return 1 + + print(f"region_format_16 {result['action']} successfully!") + print(f" Endian: {result['endian']}") + print(f" Entry Count: {result['entry_count']}") + print(f" Output Path: {output_path}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())