From 21ec3ebe26bff24b5fc6d96f86a441c9c9628247 Mon Sep 17 00:00:00 2001 From: plan1231 <47790831+plan1231@users.noreply.github.com> Date: Fri, 28 Oct 2022 09:54:02 -0400 Subject: Kick clients when resource pack rejected (#5440) --- src/ClientHandle.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 5a2e1d620..7fc678de0 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1884,6 +1884,19 @@ void cClientHandle::HandleUseItem(bool a_UsedMainHand) +void cClientHandle::HandleResourcePack(UInt8 a_Status) +{ + // Kick player if client declined the resource pack + if ((a_Status == 1) && cRoot::Get()->GetServer()->ShouldRequireResourcePack()) + { + Kick("You must accept the resource pack"); + } +} + + + + + void cClientHandle::HandleRespawn(void) { if (m_Player->GetHealth() > 0) -- cgit v1.2.3