From 243083e01a4b6b496ca4c0ed0a4a33499cd41936 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Mon, 15 Mar 2021 03:47:55 +0100 Subject: Adding basic Banner functionality (#4806) + Added item and block for banners Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang --- src/Protocol/Protocol_1_9.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Protocol/Protocol_1_9.cpp') diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 88f8933be..916d3c206 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -45,6 +45,7 @@ Implements the 1.9 protocol classes: #include "../Mobs/IncludeAllMonsters.h" #include "../UI/HorseWindow.h" +#include "../BlockEntities/BannerEntity.h" #include "../BlockEntities/BeaconEntity.h" #include "../BlockEntities/CommandBlockEntity.h" #include "../BlockEntities/MobHeadEntity.h" @@ -1625,6 +1626,18 @@ void cProtocol_1_9_0::WriteBlockEntity(cPacketizer & a_Pkt, const cBlockEntity & switch (a_BlockEntity.GetBlockType()) { + case E_BLOCK_WALL_BANNER: + case E_BLOCK_STANDING_BANNER: + { + auto & BannerEntity = static_cast(a_BlockEntity); + Writer.AddInt("x", BannerEntity.GetPosX()); + Writer.AddInt("y", BannerEntity.GetPosY()); + Writer.AddInt("z", BannerEntity.GetPosZ()); + Writer.AddString("id", "Banner"); + Writer.AddInt("Base", static_cast(BannerEntity.GetBaseColor())); + break; + } + case E_BLOCK_BEACON: { auto & BeaconEntity = static_cast(a_BlockEntity); -- cgit v1.2.3