summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorEthan Jones <ethan@yasfu.net>2021-09-15 19:33:45 +0200
committerGitHub <noreply@github.com>2021-09-15 19:33:45 +0200
commit9712c5507c3a063313c69ffcb4579fb93f045a31 (patch)
treebd9c33ce9050244bd823817df4e46040f8ffb3c3 /src/ClientHandle.cpp
parentIgnore dead entities and spectator players on pressure plates (#5294) (diff)
downloadcuberite-9712c5507c3a063313c69ffcb4579fb93f045a31.tar
cuberite-9712c5507c3a063313c69ffcb4579fb93f045a31.tar.gz
cuberite-9712c5507c3a063313c69ffcb4579fb93f045a31.tar.bz2
cuberite-9712c5507c3a063313c69ffcb4579fb93f045a31.tar.lz
cuberite-9712c5507c3a063313c69ffcb4579fb93f045a31.tar.xz
cuberite-9712c5507c3a063313c69ffcb4579fb93f045a31.tar.zst
cuberite-9712c5507c3a063313c69ffcb4579fb93f045a31.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index b6c423652..b356a649b 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1143,6 +1143,12 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace)
{
+ if (m_Player->IsGameModeAdventure())
+ {
+ // Players in adventure mode can't destroy blocks
+ return;
+ }
+
if (
m_HasStartedDigging &&
(a_BlockX == m_LastDigBlockX) &&