From 150ad7b9acbe8c5290eb129594f308918f32594e Mon Sep 17 00:00:00 2001 From: Alpyne Date: Sat, 31 Oct 2020 01:20:06 -0700 Subject: [PATCH] Add PlayerAction (block breaking etc) packet --- src/DedicatedServer.cpp | 6 ++++++ src/protocol/protocol.hjson | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/DedicatedServer.cpp b/src/DedicatedServer.cpp index 68ff9cb..2e823d1 100644 --- a/src/DedicatedServer.cpp +++ b/src/DedicatedServer.cpp @@ -317,4 +317,10 @@ namespace Feather for (auto& client : clients) client.SendMessage(message); } + + template <> + void DedicatedServer::HandlePacket(MinecraftClient& client, const Play::ServerboundPlayerAction& action) + { + + } } diff --git a/src/protocol/protocol.hjson b/src/protocol/protocol.hjson index 98b32a6..5e2fdcd 100644 --- a/src/protocol/protocol.hjson +++ b/src/protocol/protocol.hjson @@ -196,6 +196,28 @@ id : int64 } } + + PlayerAction: { + id: 0x1A + enums: { + Action: { + .type: varint + + StartBreakBlock: 0 + AbortBreakBlock: 1 + FinishedBreakBlock: 2 + DropItemStack: 3 + DropItem: 4 + ReleaseUseItem: 5 # shoot array, finished eating, etc + SwapItemHands: 6 + } + } + vars: { + action: Action + pos: position + direction: direction + } + } } clientbound :