diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 7b4cdfaa..25826b63 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "../../Minecraft.World/net.minecraft.world.entity.item.h" #include "../../Minecraft.World/net.minecraft.world.entity.player.h" #include "../../Minecraft.World/net.minecraft.world.level.tile.entity.h" @@ -453,7 +453,7 @@ void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param) bool CMinecraftApp::IsAppPaused() { -#if defined(_XBOX_ONE) || defined(__ORBIS__) +#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) bool paused = m_bIsAppPaused; EnterCriticalSection(&m_saveNotificationCriticalSection); if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 0095e3cc..0889da34 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1268,6 +1268,8 @@ void Minecraft::applyFrameMouseLook() void Minecraft::run_middle() { + pause = app.IsAppPaused(); + static int64_t lastTime = 0; static bool bFirstTimeIntoGame = true; static bool bAutosaveTimerSet=false; diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 621af1c5..420bba64 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -1848,7 +1848,7 @@ void MinecraftServer::run(int64_t seed, void *lpParameter) lastTime = now; // 4J Added ability to pause the server - if( !m_isServerPaused ) + if( !m_isServerPaused && !app.IsAppPaused() ) { bool didTick = false; if (levels[0]->allPlayersAreSleeping()) diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/MinecraftServer.h index 6b76c194..7be94a71 100644 --- a/Minecraft.Client/MinecraftServer.h +++ b/Minecraft.Client/MinecraftServer.h @@ -266,7 +266,7 @@ private: #endif #endif - bool IsServerPaused() { return m_isServerPaused; } + private: // 4J Added @@ -291,6 +291,7 @@ public: const wstring& getSaveFolderName() const { return m_saveFolderName; } void Suspend(); bool IsSuspending(); + bool IsServerPaused() { return m_isServerPaused; } // 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them }; diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index 845d9ee3..80cef559 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -183,7 +183,7 @@ void PlayerConnection::tick() // Ensure server-side player tick runs even when no move packet was received this tick. // Without this, environmental damage (drowning, fire, lava) is never applied to clients // that don't send frequent move packets. - if (!didTick && player != nullptr) + if (!didTick && player != nullptr && !server->IsServerPaused() && !app.IsAppPaused()) { player->doTick(false); }