From 179d6da490636799fd765298c9e3d884d9d980a1 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 20 Jul 2021 20:48:05 +0200 Subject: Setting command-block's command requires a permission. (#5270) --- src/ClientHandle.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index e5f001116..d36f27d8c 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -940,6 +940,11 @@ void cClientHandle::HandleCommandBlockBlockChange(int a_BlockX, int a_BlockY, in Kick("Command block string unexpectedly empty - hacked client?"); return; } + if ((m_Player == nullptr) || !m_Player->HasPermission("comandblock.set")) + { + SendChat("You cannot edit command blocks on this server", mtFailure); + return; + } cWorld * World = m_Player->GetWorld(); if (World->AreCommandBlocksEnabled()) -- cgit v1.2.3