diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a1c3e74aa..215d21dfc 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,20 @@ ## Description @@ -19,6 +34,9 @@ Note: IF YOUR PR CHANGES THE GAME BEHAVIOR VISIBLY, REMEMBER TO ATTACH A GAMEPLA ### Fix Implementation +### AI Use Disclosure + + ## Related Issues - Fixes #[issue-number] - Related to #[issue-number] diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4ef1274d2..ddbfbc0e1 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -36,7 +36,11 @@ jobs: with: tag_name: nightly name: Nightly Release - body: Requires at least Windows 7 and DirectX 11 compatible GPU to run. Compiled with MSVC v14.44.35207 in Release mode with Whole Program Optimization, as well as `/O2 /Ot /Oi /Ob3 /GF /fp:precise`. + body: | + Requires at least Windows 7 and DirectX 11 compatible GPU to run. Compiled with MSVC v14.44.35207 in Release mode with Whole Program Optimization, as well as `/O2 /Ot /Oi /Ob3 /GF /fp:precise`. + + # 🚨 First time here? 🚨 + If you've never downloaded the game before, you need to download `LCEWindows64.zip` and extract it to the folder where you'd like to keep the game. The other files are included in this `.zip` file! files: | LCEWindows64.zip ./x64/Release/Minecraft.Client.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d83c5c8e..916f13157 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,13 +89,59 @@ target_link_libraries(MinecraftClient PRIVATE > ) -add_custom_command(TARGET MinecraftClient POST_BUILD - COMMAND "${CMAKE_COMMAND}" - -DPROJECT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" - -DOUTPUT_DIR="$" - -DCONFIGURATION=$ - -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/CopyAssets.cmake" - VERBATIM -) +if(WIN32) + message(STATUS "Starting redist copy...") + execute_process( + COMMAND robocopy.exe + "${CMAKE_CURRENT_SOURCE_DIR}/x64/Release" + "${CMAKE_CURRENT_BINARY_DIR}" + /S /MT /R:0 /W:0 /NP + ) + message(STATUS "Starting asset copy...") + execute_process( + COMMAND robocopy.exe + "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client" + "${CMAKE_CURRENT_BINARY_DIR}" + /S /MT /R:0 /W:0 /NP + /XF "*.cpp" "*.c" "*.h" "*.hpp" "*.asm" + "*.xml" "*.lang" "*.vcxproj" "*.vcxproj.*" "*.sln" + "*.docx" "*.xls" + "*.bat" "*.cmd" "*.ps1" "*.py" + "*Test*" + /XD "Durango*" "Orbis*" "PS*" "Xbox" + ) + message(STATUS "Patching Windows64Media...") + execute_process( + COMMAND robocopy.exe + "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/DurangoMedia" + "${CMAKE_CURRENT_BINARY_DIR}/Windows64Media" + /S /MT /R:0 /W:0 /NP + /XF "*.h" "*.xml" "*.lang" "*.bat" + ) +elseif(UNIX) + message(STATUS "Starting redist copy...") + execute_process( + COMMAND rsync -av "${CMAKE_CURRENT_SOURCE_DIR}/x64/Release/" "${CMAKE_CURRENT_BINARY_DIR}/" + ) + message(STATUS "Starting asset copy...") + execute_process( + COMMAND rsync -av + "--exclude=*.cpp" "--exclude=*.c" "--exclude=*.h" "--exclude=*.hpp" "--exclude=*.asm" + "--exclude=*.xml" "--exclude=*.lang" "--exclude=*.vcxproj" "--exclude=*.vcxproj.*" "--exclude=*.sln" + "--exclude=*.docx" "--exclude=*.xls" + "--exclude=*.bat" "--exclude=*.cmd" "--exclude=*.ps1" "--exclude=*.py" + "--exclude=*Test*" + "--exclude=Durango*" "--exclude=Orbis*" "--exclude=PS*" "--exclude=Xbox" + "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/" "${CMAKE_CURRENT_BINARY_DIR}/" + ) + message(STATUS "Patching Windows64Media...") + execute_process( + COMMAND rsync -av + "--exclude=*.h" "--exclude=*.xml" "--exclude=*.lang" "--exclude=*.bat" + "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/DurangoMedia/" "${CMAKE_CURRENT_BINARY_DIR}/Windows64Media/" + ) +else() + message(FATAL_ERROR "Redist and asset copying is only supported on Windows (Robocopy) and Unix systems (rsync).") +endif() set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MinecraftClient) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..5166a3c42 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ +# Scope of Project +At the moment, this project's scope is generally limited outside of adding new content to the game (blocks, mobs, items). We are currently prioritizing stability, quality of life, and platform support over these things. + +## Current Goals +- Being a robust Desktop version of LCE +- Having proper controller support across all types, brands on Desktop or Desktop-like platforms (Steam Deck) +- Improving stability as much as possible +- Fixing as many bugs as possible +- Enabling Desktop multiplayer options + - LAN P2P Multiplayer + - Splitscreen Multiplayer + - WAN Servers (IP:Port connectivity) + - Platform-based P2P Connectivity + - Steam Networking + - GameDate? + - Maybe more? +- Refining rendering settings, renderer options, as well as reaching rendering parity with true LCE +- Having workable multi-platform compilation for ARM, Consoles, Linux +- Being a good base for further expansion and modding of LCE, such as backports and "modpacks". + +# Use of AI and LLMs +We currently do not accept any new code into the project that was written largely, entirely, or even noticably by an LLM. All contributions should be made by humans that understand the codebase. + +# Pull Request Template +We request that all PRs made for this repo use our PR template to the fullest extent possible. Completely wiping it out to write minimal information will likely get your PR closed. \ No newline at end of file diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 8123a2f0b..02a7837db 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -2694,6 +2694,10 @@ void ClientConnection::handleRespawn(shared_ptr packet) int oldDimension = minecraft->localplayers[m_userIndex]->dimension; started = false; + // Stop any streaming music (e.g. jukebox) when changing dimensions + // so it doesn't leak into the new dimension + level->playStreamingMusic(L"", 0, 0, 0); + // Remove client connection from this level level->removeClientConnection(this, false); diff --git a/Minecraft.Client/Common/Media/MediaWindows64.arc b/Minecraft.Client/Common/Media/MediaWindows64.arc index af524a794..4c17b74b4 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64.arc and b/Minecraft.Client/Common/Media/MediaWindows64.arc differ diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp index c2466fe39..e5824bd41 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp @@ -7,6 +7,7 @@ #include "..\..\Windows64\Network\WinsockNetLayer.h" #include "..\..\Minecraft.h" #include "..\..\User.h" +#include #endif CPlatformNetworkManagerStub *g_pPlatformNetworkManager; @@ -700,6 +701,7 @@ void CPlatformNetworkManagerStub::SearchForGames() #ifdef _WINDOWS64 std::vector lanSessions = WinsockNetLayer::GetDiscoveredSessions(); + //THEY GET DELETED HERE DAMMIT for (size_t i = 0; i < friendsSessions[0].size(); i++) delete friendsSessions[0][i]; friendsSessions[0].clear(); @@ -730,6 +732,53 @@ void CPlatformNetworkManagerStub::SearchForGames() friendsSessions[0].push_back(info); } + std::FILE* file = std::fopen("servers.txt", "r"); + + if (file) { + wstring wline; + int phase = 0; + + string ip; + wstring port; + wstring name; + + char buffer[512]; + while (std::fgets(buffer, sizeof(buffer), file)) { + if (phase == 0) { + ip = buffer; + phase = 1; + } + else if (phase == 1) { + wline = convStringToWstring(buffer); + port = wline; + phase = 2; + } + else if (phase == 2) { + wline = convStringToWstring(buffer); + name = wline; + phase = 0; + + //THEY GET DELETED AFTER USE LIKE 30 LINES UP!! + FriendSessionInfo* info = new FriendSessionInfo(); + wchar_t label[128]; + wcsncpy_s(label, sizeof(label)/sizeof(wchar_t), name.c_str(), _TRUNCATE); + size_t nameLen = wcslen(label); + info->displayLabel = new wchar_t[nameLen+1]; + wcscpy_s(info->displayLabel, nameLen + 1, label); + info->displayLabelLength = (unsigned char)nameLen; + info->displayLabelViewableStartIndex = 0; + info->data.isReadyToJoin = true; + info->data.isJoinable = true; + strncpy_s(info->data.hostIP, sizeof(info->data.hostIP), ip.c_str(), _TRUNCATE); + info->data.hostPort = stoi(port); + info->sessionId = (SessionID)(static_cast(inet_addr(ip.c_str())) | (static_cast(stoi(port)) << 32)); + friendsSessions[0].push_back(info); + } + } + + std::fclose(file); + } + m_searchResultsCount[0] = (int)friendsSessions[0].size(); if (m_SessionsUpdatedCallback != NULL) diff --git a/Minecraft.Client/Common/UI/IUIScene_BeaconMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_BeaconMenu.cpp index 76d21406c..bb13deb89 100644 --- a/Minecraft.Client/Common/UI/IUIScene_BeaconMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_BeaconMenu.cpp @@ -387,8 +387,10 @@ vector *IUIScene_BeaconMenu::GetSectionHoverText(ESceneSection eSect desc = new vector(); - HtmlString string( app.GetString(MobEffect::effects[effectId]->getDescriptionId()), eHTMLColor_White ); - desc->push_back( string ); + if (effectId < MobEffect::e_MobEffectIcon_COUNT && MobEffect::effects[effectId]) { + HtmlString string( app.GetString(MobEffect::effects[effectId]->getDescriptionId()), eHTMLColor_White ); + desc->push_back( string ); + } } break; } diff --git a/Minecraft.Client/CreeperModel.cpp b/Minecraft.Client/CreeperModel.cpp index dd9ef193f..99d7d4735 100644 --- a/Minecraft.Client/CreeperModel.cpp +++ b/Minecraft.Client/CreeperModel.cpp @@ -6,35 +6,33 @@ // 4J - added void CreeperModel::_init(float g) { - int yo = 4; - head = new ModelPart(this, 0, 0); head->addBox(-4, - 8, -4, 8, 8, 8, g); // Head - head->setPos(0, (float)(yo), 0); + head->setPos(0, 6, 0); hair = new ModelPart(this, 32, 0); hair->addBox(-4, -8, -4, 8, 8, 8, g + 0.5f); // Head - hair->setPos(0, (float)(yo), 0); + hair->setPos(0, 6, 0); body = new ModelPart(this, 16, 16); body->addBox(-4, 0, -2, 8, 12, 4, g); // Body - body->setPos(0, (float)(yo), 0); + body->setPos(0, 6, 0); leg0 = new ModelPart(this, 0, 16); leg0->addBox(-2, 0, -2, 4, 6, 4, g); // Leg0 - leg0->setPos(-2, (float)(12 + yo), 4); + leg0->setPos(-2, 18, 4); leg1 = new ModelPart(this, 0, 16); leg1->addBox(-2, 0, -2, 4, 6, 4, g); // Leg1 - leg1->setPos(2, (float)(12 + yo), 4); + leg1->setPos(2, 18, 4); leg2 = new ModelPart(this, 0, 16); leg2->addBox(-2, 0, -2, 4, 6, 4, g); // Leg2 - leg2->setPos(-2, (float)(12 + yo), -4); + leg2->setPos(-2, 18, -4); leg3 = new ModelPart(this, 0, 16); leg3->addBox(-2, 0, -2, 4, 6, 4, g); // Leg3 - leg3->setPos(2, (float)(12 + yo), -4); + leg3->setPos(2, 18, -4); // 4J added - compile now to avoid random performance hit first time cubes are rendered head->compile(1.0f/16.0f); diff --git a/Minecraft.Client/DurangoMedia/DLC/Candy Texture Pack/Data/x16Data.pck b/Minecraft.Client/DurangoMedia/DLC/Candy Texture Pack/Data/x16Data.pck index db0222c4b..c5043050e 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Candy Texture Pack/Data/x16Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Candy Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Cartoon Texture Pack/Data/x32Data.pck b/Minecraft.Client/DurangoMedia/DLC/Cartoon Texture Pack/Data/x32Data.pck index 3752e75aa..023d98736 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Cartoon Texture Pack/Data/x32Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Cartoon Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/City Texture Pack/Data/x32Data.pck b/Minecraft.Client/DurangoMedia/DLC/City Texture Pack/Data/x32Data.pck index 61161ba4e..7f13bcbfb 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/City Texture Pack/Data/x32Data.pck and b/Minecraft.Client/DurangoMedia/DLC/City Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Fantasy Texture Pack/Data/x32Data.pck b/Minecraft.Client/DurangoMedia/DLC/Fantasy Texture Pack/Data/x32Data.pck index 64618ef7a..707b88a50 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Fantasy Texture Pack/Data/x32Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Fantasy Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Halloween Texture Pack/Data/x16Data.pck b/Minecraft.Client/DurangoMedia/DLC/Halloween Texture Pack/Data/x16Data.pck index 719d0e282..4d8615afb 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Halloween Texture Pack/Data/x16Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Halloween Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Halo/Data/x16Data.pck b/Minecraft.Client/DurangoMedia/DLC/Halo/Data/x16Data.pck index eeea0eaa7..d957bfb73 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Halo/Data/x16Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Halo/Data/x16Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Mass Effect/Data/x16Data.pck b/Minecraft.Client/DurangoMedia/DLC/Mass Effect/Data/x16Data.pck index 1f03ff10c..08f4f3b44 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Mass Effect/Data/x16Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Mass Effect/Data/x16Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Natural Texture Pack/Data/x32Data.pck b/Minecraft.Client/DurangoMedia/DLC/Natural Texture Pack/Data/x32Data.pck index cafb05e09..faa22e80c 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Natural Texture Pack/Data/x32Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Natural Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Plastic Texture Pack/Data/x16Data.pck b/Minecraft.Client/DurangoMedia/DLC/Plastic Texture Pack/Data/x16Data.pck index 979f75c8b..7255afcb5 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Plastic Texture Pack/Data/x16Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Plastic Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck b/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck index 66a1be365..e78564c9c 100644 Binary files a/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck and b/Minecraft.Client/DurangoMedia/DLC/Skyrim/Data/x16Data.pck differ diff --git a/Minecraft.Client/EntityTracker.cpp b/Minecraft.Client/EntityTracker.cpp index adc230eea..0d7d424c6 100644 --- a/Minecraft.Client/EntityTracker.cpp +++ b/Minecraft.Client/EntityTracker.cpp @@ -54,13 +54,13 @@ void EntityTracker::addEntity(shared_ptr e) else if (e->instanceof(eTYPE_THROWNEXPBOTTLE)) addEntity(e, 16 * 4, 10, true); else if (e->instanceof(eTYPE_FIREWORKS_ROCKET)) addEntity(e, 16 * 4, 10, true); else if (e->instanceof(eTYPE_ITEMENTITY)) addEntity(e, 16 * 4, 20, true); - else if (e->instanceof(eTYPE_MINECART)) addEntity(e, 16 * 5, 3, true); - else if (e->instanceof(eTYPE_BOAT)) addEntity(e, 16 * 5, 3, true); - else if (e->instanceof(eTYPE_SQUID)) addEntity(e, 16 * 4, 3, true); - else if (e->instanceof(eTYPE_WITHERBOSS)) addEntity(e, 16 * 5, 3, false); - else if (e->instanceof(eTYPE_BAT)) addEntity(e, 16 * 5, 3, false); - else if (dynamic_pointer_cast(e)!=NULL) addEntity(e, 16 * 5, 3, true); - else if (e->instanceof(eTYPE_ENDERDRAGON)) addEntity(e, 16 * 10, 3, true); + else if (e->instanceof(eTYPE_MINECART)) addEntity(e, 16 * 5, 1, true); + else if (e->instanceof(eTYPE_BOAT)) addEntity(e, 16 * 5, 1, true); + else if (e->instanceof(eTYPE_SQUID)) addEntity(e, 16 * 4, 1, true); + else if (e->instanceof(eTYPE_WITHERBOSS)) addEntity(e, 16 * 5, 1, false); + else if (e->instanceof(eTYPE_BAT)) addEntity(e, 16 * 5, 1, false); + else if (dynamic_pointer_cast(e)!=NULL) addEntity(e, 16 * 5, 1, true); + else if (e->instanceof(eTYPE_ENDERDRAGON)) addEntity(e, 16 * 10, 1, true); else if (e->instanceof(eTYPE_PRIMEDTNT)) addEntity(e, 16 * 10, 10, true); else if (e->instanceof(eTYPE_FALLINGTILE)) addEntity(e, 16 * 10, 20, true); else if (e->instanceof(eTYPE_HANGING_ENTITY)) addEntity(e, 16 * 10, INT_MAX, false); @@ -245,4 +245,4 @@ shared_ptr EntityTracker::getTracker(shared_ptr e) return it->second; } return nullptr; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Input.cpp b/Minecraft.Client/Input.cpp index 4d931d3e6..1fd676836 100644 --- a/Minecraft.Client/Input.cpp +++ b/Minecraft.Client/Input.cpp @@ -104,8 +104,7 @@ void Input::tick(LocalPlayer *player) } } - // Ctrl + forward = sprint (hold to sprint) - if (!player->abilities.flying) + // Ctrl + forward = sprint (hold to sprint, including while flying) { bool ctrlHeld = g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_SPRINT); bool movingForward = (kbYA > 0.0f); @@ -119,10 +118,6 @@ void Input::tick(LocalPlayer *player) sprinting = false; } } - else - { - sprinting = false; - } } else if (iPad == 0) { diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 19ee79bdb..3cc9ac59c 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1485,7 +1485,7 @@ void Minecraft::run_middle() } // Utility keys always work regardless of KBM active state - if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_PAUSE) && !ui.IsTutorialVisible(i)) + if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_PAUSE) && !ui.IsTutorialVisible(i) && !ui.GetMenuDisplayed(i)) { localplayers[i]->ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<ullButtonsPressed|=1LL<levelEvent(LevelEvent::PARTICLES_DESTROY_BLOCK, x, y, z, oldTile->id + (level->getData(x, y, z) << Tile::TILE_NUM_SHIFT)); - return true; } #endif diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.h b/Minecraft.Client/Windows64/KeyboardMouseInput.h index 89a028b10..5945b26a5 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.h +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h @@ -30,6 +30,7 @@ public: static const int KEY_PAUSE = VK_ESCAPE; static const int KEY_THIRD_PERSON = VK_F5; static const int KEY_DEBUG_INFO = VK_F3; + static const int KEY_DEBUG_MENU = VK_F4; void Init(); void Tick(); diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 49c43ceac..d38ad4423 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -1569,19 +1569,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } #ifdef _DEBUG_MENUS_ENABLED - // F4 Open debug overlay - if (g_KBMInput.IsKeyPressed(VK_F4)) - { - if (Minecraft *pMinecraft = Minecraft::GetInstance()) - { - if (pMinecraft->options && - app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL) - { - ui.NavigateToScene(0, eUIScene_DebugOverlay, NULL, eUILayer_Debug); - } - } - } - // F6 Open debug console if (g_KBMInput.IsKeyPressed(VK_F6)) { diff --git a/Minecraft.Client/Windows64Media/DLC/Candy Texture Pack/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Candy Texture Pack/Data/x16Data.pck index a282f83ab..e563879f0 100644 Binary files a/Minecraft.Client/Windows64Media/DLC/Candy Texture Pack/Data/x16Data.pck and b/Minecraft.Client/Windows64Media/DLC/Candy Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/City Texture Pack/Data/x32Data.pck b/Minecraft.Client/Windows64Media/DLC/City Texture Pack/Data/x32Data.pck index 0d9f13c98..63aba9a10 100644 Binary files a/Minecraft.Client/Windows64Media/DLC/City Texture Pack/Data/x32Data.pck and b/Minecraft.Client/Windows64Media/DLC/City Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Fantasy Texture Pack/Data/x32Data.pck b/Minecraft.Client/Windows64Media/DLC/Fantasy Texture Pack/Data/x32Data.pck index 702045319..e42a1ab3f 100644 Binary files a/Minecraft.Client/Windows64Media/DLC/Fantasy Texture Pack/Data/x32Data.pck and b/Minecraft.Client/Windows64Media/DLC/Fantasy Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Halloween Texture Pack/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Halloween Texture Pack/Data/x16Data.pck index 6d1f4da85..afedf110c 100644 Binary files a/Minecraft.Client/Windows64Media/DLC/Halloween Texture Pack/Data/x16Data.pck and b/Minecraft.Client/Windows64Media/DLC/Halloween Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Natural Texture Pack/Data/x32Data.pck b/Minecraft.Client/Windows64Media/DLC/Natural Texture Pack/Data/x32Data.pck index 5bc5b54af..c5f592c42 100644 Binary files a/Minecraft.Client/Windows64Media/DLC/Natural Texture Pack/Data/x32Data.pck and b/Minecraft.Client/Windows64Media/DLC/Natural Texture Pack/Data/x32Data.pck differ diff --git a/Minecraft.Client/Windows64Media/DLC/Plastic Texture Pack/Data/x16Data.pck b/Minecraft.Client/Windows64Media/DLC/Plastic Texture Pack/Data/x16Data.pck index 57b913bcf..adf5d39ca 100644 Binary files a/Minecraft.Client/Windows64Media/DLC/Plastic Texture Pack/Data/x16Data.pck and b/Minecraft.Client/Windows64Media/DLC/Plastic Texture Pack/Data/x16Data.pck differ diff --git a/Minecraft.Client/Windows64Media/Media/logo-original.png b/Minecraft.Client/Windows64Media/Media/logo-original.png new file mode 100644 index 000000000..3d1637f87 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Media/logo-original.png differ diff --git a/Minecraft.Client/Windows64Media/Media/logo-tempscaled.png b/Minecraft.Client/Windows64Media/Media/logo-tempscaled.png new file mode 100644 index 000000000..ad2839b9b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Media/logo-tempscaled.png differ diff --git a/Minecraft.Client/Windows64Media/Media/skinHDWin.swf b/Minecraft.Client/Windows64Media/Media/skinHDWin.swf index 594db8a43..6d1a79fa4 100644 Binary files a/Minecraft.Client/Windows64Media/Media/skinHDWin.swf and b/Minecraft.Client/Windows64Media/Media/skinHDWin.swf differ diff --git a/Minecraft.World/ItemDispenseBehaviors.cpp b/Minecraft.World/ItemDispenseBehaviors.cpp index f66afe31b..08c73a0c1 100644 --- a/Minecraft.World/ItemDispenseBehaviors.cpp +++ b/Minecraft.World/ItemDispenseBehaviors.cpp @@ -288,10 +288,10 @@ shared_ptr FilledBucketDispenseBehavior::execute(BlockSource *sour return dispensed; } - return DefaultDispenseItemBehavior::dispense(source, dispensed); + outcome = LEFT_ITEM; + return dispensed; } - /* EmptyBucket */ shared_ptr EmptyBucketDispenseBehavior::execute(BlockSource *source, shared_ptr dispensed, eOUTCOME &outcome) @@ -454,4 +454,4 @@ shared_ptr TntDispenseBehavior::execute(BlockSource *source, share outcome = LEFT_ITEM; } return dispensed; -} \ No newline at end of file +} diff --git a/Minecraft.World/PanicGoal.cpp b/Minecraft.World/PanicGoal.cpp index 564fa59da..cb9fc3f3a 100644 --- a/Minecraft.World/PanicGoal.cpp +++ b/Minecraft.World/PanicGoal.cpp @@ -10,17 +10,24 @@ PanicGoal::PanicGoal(PathfinderMob *mob, double speedModifier) { this->mob = mob; this->speedModifier = speedModifier; - setRequiredControlFlags(Control::MoveControlFlag); + Goal::setRequiredControlFlags(Control::MoveControlFlag); } bool PanicGoal::canUse() { - if (mob->getLastHurtByMob() == NULL && !mob->isOnFire()) return false; - Vec3 *pos = RandomPos::getPos(dynamic_pointer_cast(mob->shared_from_this()), 5, 4); - if (pos == NULL) return false; + if (mob->getLastHurtByMob() == nullptr && !mob->isOnFire()) return false; + const int hurtTimeout = mob->getLastHurtByMobTimestamp(); + if (hurtTimeout == 0) return false; + static thread_local std::mt19937 rng(std::random_device{}()); + std::uniform_int_distribution dist(60, 100); + const int panicDuration = dist(rng); + if (mob->tickCount - hurtTimeout > panicDuration) return false; + const Vec3* pos = RandomPos::getPos(dynamic_pointer_cast(mob->shared_from_this()), 5, 4); + if (pos == nullptr) return false; posX = pos->x; posY = pos->y; posZ = pos->z; + return true; } @@ -31,5 +38,6 @@ void PanicGoal::start() bool PanicGoal::canContinueToUse() { + if (mob->getLastHurtByMob() == nullptr && !mob->isOnFire()) return false; return !mob->getNavigation()->isDone(); } \ No newline at end of file diff --git a/Minecraft.World/PanicGoal.h b/Minecraft.World/PanicGoal.h index 2db64a75e..65a4e6d83 100644 --- a/Minecraft.World/PanicGoal.h +++ b/Minecraft.World/PanicGoal.h @@ -1,6 +1,7 @@ #pragma once #include "Goal.h" +#include class PathfinderMob; diff --git a/Minecraft.World/SignTileEntity.cpp b/Minecraft.World/SignTileEntity.cpp index 74adc8ccc..dc189102b 100644 --- a/Minecraft.World/SignTileEntity.cpp +++ b/Minecraft.World/SignTileEntity.cpp @@ -166,9 +166,15 @@ void SignTileEntity::setChanged() void SignTileEntity::SetMessage(int iIndex,wstring &wsText) -{ +{ + if (wsText.length() > MAX_LINE_LENGTH) // MAX_LINE_LENGTH == 15 + { + wsText = wsText.substr(0, MAX_LINE_LENGTH); +#ifdef _DEBUG + OutputDebugStringW(L"Sign text truncated to 15 characters\n"); +#endif + } m_wsmessages[iIndex]=wsText; - } // 4J-PB - added for string verification diff --git a/Minecraft.World/WitherBoss.cpp b/Minecraft.World/WitherBoss.cpp index 676f07d94..84cf13825 100644 --- a/Minecraft.World/WitherBoss.cpp +++ b/Minecraft.World/WitherBoss.cpp @@ -535,7 +535,7 @@ void WitherBoss::registerAttributes() getAttribute(SharedMonsterAttributes::MOVEMENT_SPEED)->setBaseValue(0.6f); // 4J Stu - Don't make it so far! - //getAttribute(SharedMonsterAttributes::FOLLOW_RANGE)->setBaseValue(40); + getAttribute(SharedMonsterAttributes::FOLLOW_RANGE)->setBaseValue(40); } float WitherBoss::getHeadYRot(int i) @@ -581,4 +581,4 @@ MobType WitherBoss::getMobType() void WitherBoss::ride(shared_ptr e) { riding = nullptr; -} \ No newline at end of file +} diff --git a/Minecraft.World/Zombie.cpp b/Minecraft.World/Zombie.cpp index df9d5c6b7..7cdc31809 100644 --- a/Minecraft.World/Zombie.cpp +++ b/Minecraft.World/Zombie.cpp @@ -56,7 +56,7 @@ void Zombie::registerAttributes() Monster::registerAttributes(); // 4J Stu - Don't make it so far! - //getAttribute(SharedMonsterAttributes::FOLLOW_RANGE)->setBaseValue(40); + getAttribute(SharedMonsterAttributes::FOLLOW_RANGE)->setBaseValue(40); getAttribute(SharedMonsterAttributes::MOVEMENT_SPEED)->setBaseValue(0.23f); getAttribute(SharedMonsterAttributes::ATTACK_DAMAGE)->setBaseValue(3); @@ -490,4 +490,4 @@ Zombie::ZombieGroupData::ZombieGroupData(bool baby, bool villager) { isBaby = baby; isVillager = villager; -} \ No newline at end of file +} diff --git a/README.md b/README.md index 960deff38..e5eca563d 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,9 @@ For more information, see [COMPILE.md](COMPILE.md) - Native builds for platforms other than Windows have not been tested and are most likely non-functional. The Windows nightly build may still run on macOS and Linux through Wine or CrossOver, but that path is unofficial and not currently supported +## Contributors +Would you like to contribute to this project? Please read our [Contributor's Guide](CONTRIBUTING.md) before doing so! This document includes our current goals, standards for inclusions, rules, and more. + ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=smartcmd/MinecraftConsoles&type=date&legend=top-left)](https://www.star-history.com/?spm=a2c6h.12873639.article-detail.7.7b9d7fabjNxTRk#smartcmd/MinecraftConsoles&type=date&legend=top-left) diff --git a/cmake/CopyAssets.cmake b/cmake/CopyAssets.cmake deleted file mode 100644 index a0252f730..000000000 --- a/cmake/CopyAssets.cmake +++ /dev/null @@ -1,107 +0,0 @@ -if(NOT DEFINED PROJECT_SOURCE_DIR OR NOT DEFINED OUTPUT_DIR OR NOT DEFINED CONFIGURATION) - message(FATAL_ERROR "CopyAssets.cmake requires PROJECT_SOURCE_DIR, OUTPUT_DIR, and CONFIGURATION.") -endif() - -# Some generators may pass quoted values (e.g. "Debug"); normalize that. -string(REPLACE "\"" "" PROJECT_SOURCE_DIR "${PROJECT_SOURCE_DIR}") -string(REPLACE "\"" "" OUTPUT_DIR "${OUTPUT_DIR}") -string(REPLACE "\"" "" CONFIGURATION "${CONFIGURATION}") - -set(_project_dir "${PROJECT_SOURCE_DIR}/Minecraft.Client") - -function(copy_tree_if_exists src_rel dst_rel) - set(_src "${_project_dir}/${src_rel}") - set(_dst "${OUTPUT_DIR}/${dst_rel}") - - if(EXISTS "${_src}") - file(MAKE_DIRECTORY "${_dst}") - file(GLOB_RECURSE _files RELATIVE "${_src}" "${_src}/*") - - foreach(_file IN LISTS _files) # if not a source file - if(NOT _file MATCHES "\\.(cpp|c|h|hpp|xml|lang)$") - set(_full_src "${_src}/${_file}") - set(_full_dst "${_dst}/${_file}") - - if(IS_DIRECTORY "${_full_src}") - file(MAKE_DIRECTORY "${_full_dst}") - else() - get_filename_component(_dst_dir "${_full_dst}" DIRECTORY) - file(MAKE_DIRECTORY "${_dst_dir}") - execute_process( - COMMAND "${CMAKE_COMMAND}" -E copy_if_different - "${_full_src}" "${_full_dst}" - ) - endif() - endif() - endforeach() - endif() -endfunction() - -function(ensure_dir rel_path) - file(MAKE_DIRECTORY "${OUTPUT_DIR}/${rel_path}") -endfunction() - -function(copy_file_if_exists src_rel dst_rel) - set(_src "${PROJECT_SOURCE_DIR}/${src_rel}") - set(_dst "${OUTPUT_DIR}/${dst_rel}") - - get_filename_component(_dst_dir "${_dst}" DIRECTORY) - file(MAKE_DIRECTORY "${_dst_dir}") - - if(EXISTS "${_src}") - execute_process( - COMMAND "${CMAKE_COMMAND}" -E copy_if_different - "${_src}" "${_dst}" - ) - endif() -endfunction() - -function(copy_first_existing dst_rel) - set(_copied FALSE) - foreach(_candidate IN LISTS ARGN) - if(EXISTS "${PROJECT_SOURCE_DIR}/${_candidate}") - copy_file_if_exists("${_candidate}" "${dst_rel}") - set(_copied TRUE) - break() - endif() - endforeach() - if(NOT _copied) - message(WARNING "Runtime file not found for ${dst_rel}. Checked: ${ARGN}") - endif() -endfunction() - -function(remove_directory_if_exists rel_path) - set(_dir "${OUTPUT_DIR}/${rel_path}") - if(EXISTS "${_dir}") - file(REMOVE_RECURSE "${_dir}") - endif() -endfunction() - -copy_tree_if_exists("Durango/Sound" "Windows64/Sound") -copy_tree_if_exists("music" "music") -copy_tree_if_exists("Windows64/GameHDD" "Windows64/GameHDD") -copy_file_if_exists("Minecraft.Client/Common/Media/MediaWindows64.arc" "Common/Media/MediaWindows64.arc") -copy_tree_if_exists("Common/res" "Common/res") -copy_tree_if_exists("Common/Trial" "Common/Trial") -copy_tree_if_exists("Common/Tutorial" "Common/Tutorial") -copy_tree_if_exists("DurangoMedia" "Windows64Media") -copy_tree_if_exists("Windows64Media" "Windows64Media") - -remove_directory_if_exists("Windows64Media/Layout") - -# Some runtime code asserts if this directory tree is missing. -ensure_dir("Windows64/GameHDD") - -# Keep legacy runtime redistributables in a familiar location. -copy_tree_if_exists("Windows64/Miles/lib/redist64" "redist64") -copy_tree_if_exists("Windows64/Iggy/lib/redist64" "redist64") - -# Runtime DLLs required at launch. -copy_first_existing("iggy_w64.dll" - "Minecraft.Client/Windows64/Iggy/lib/redist64/iggy_w64.dll" - "x64/${CONFIGURATION}/iggy_w64.dll" -) -copy_first_existing("mss64.dll" - "Minecraft.Client/Windows64/Miles/lib/redist64/mss64.dll" - "x64/${CONFIGURATION}/mss64.dll" -)