summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol_1_10.cpp13
-rw-r--r--src/Protocol/Protocol_1_11.cpp13
-rw-r--r--src/Protocol/Protocol_1_8.cpp28
-rw-r--r--src/Protocol/Protocol_1_9.cpp13
4 files changed, 60 insertions, 7 deletions
diff --git a/src/Protocol/Protocol_1_10.cpp b/src/Protocol/Protocol_1_10.cpp
index 89bc3f010..6b88fbe2a 100644
--- a/src/Protocol/Protocol_1_10.cpp
+++ b/src/Protocol/Protocol_1_10.cpp
@@ -35,6 +35,7 @@ Implements the 1.10 protocol classes:
#include "../Mobs/IncludeAllMonsters.h"
+#include "../BlockEntities/BannerEntity.h"
#include "../BlockEntities/BeaconEntity.h"
#include "../BlockEntities/CommandBlockEntity.h"
#include "../BlockEntities/MobHeadEntity.h"
@@ -586,6 +587,18 @@ void cProtocol_1_10_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<const cBannerEntity &>(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<Int32>(BannerEntity.GetBaseColor()));
+ break;
+ }
+
case E_BLOCK_BEACON:
{
auto & BeaconEntity = static_cast<const cBeaconEntity &>(a_BlockEntity);
diff --git a/src/Protocol/Protocol_1_11.cpp b/src/Protocol/Protocol_1_11.cpp
index c8ba78e62..424116b94 100644
--- a/src/Protocol/Protocol_1_11.cpp
+++ b/src/Protocol/Protocol_1_11.cpp
@@ -30,6 +30,7 @@ Implements the 1.11 protocol classes:
#include "../Mobs/IncludeAllMonsters.h"
+#include "../BlockEntities/BannerEntity.h"
#include "../BlockEntities/BeaconEntity.h"
#include "../BlockEntities/BedEntity.h"
#include "../BlockEntities/CommandBlockEntity.h"
@@ -416,6 +417,18 @@ void cProtocol_1_11_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<const cBannerEntity &>(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<Int32>(BannerEntity.GetBaseColor()));
+ break;
+ }
+
case E_BLOCK_BEACON:
{
auto & BeaconEntity = static_cast<const cBeaconEntity &>(a_BlockEntity);
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 8e7b74614..1a1229f05 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -42,6 +42,7 @@ Implements the 1.8 protocol classes:
#include "../UI/Window.h"
#include "../UI/HorseWindow.h"
+#include "../BlockEntities/BannerEntity.h"
#include "../BlockEntities/BeaconEntity.h"
#include "../BlockEntities/CommandBlockEntity.h"
#include "../BlockEntities/EnchantingTableEntity.h"
@@ -1603,13 +1604,14 @@ void cProtocol_1_8_0::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
Byte Action = 0;
switch (a_BlockEntity.GetBlockType())
{
- case E_BLOCK_MOB_SPAWNER: Action = 1; break; // Update mob spawner spinny mob thing
- case E_BLOCK_COMMAND_BLOCK: Action = 2; break; // Update command block text
- case E_BLOCK_BEACON: Action = 3; break; // Update beacon entity
- case E_BLOCK_HEAD: Action = 4; break; // Update Mobhead entity
- case E_BLOCK_FLOWER_POT: Action = 5; break; // Update flower pot
- case E_BLOCK_BED: Action = 11; break; // Update bed color
-
+ case E_BLOCK_MOB_SPAWNER: Action = 1; break; // Update mob spawner spinny mob thing
+ case E_BLOCK_COMMAND_BLOCK: Action = 2; break; // Update command block text
+ case E_BLOCK_BEACON: Action = 3; break; // Update beacon entity
+ case E_BLOCK_HEAD: Action = 4; break; // Update Mobhead entity
+ case E_BLOCK_FLOWER_POT: Action = 5; break; // Update flower pot
+ case E_BLOCK_WALL_BANNER:
+ case E_BLOCK_STANDING_BANNER: Action = 6; break; // Update Banner
+ case E_BLOCK_BED: Action = 11; break; // Update bed color
case E_BLOCK_ENCHANTMENT_TABLE: Action = 0; break; // The ones with a action of 0 is just a workaround to send the block entities to a client.
case E_BLOCK_END_PORTAL: Action = 0; break; // Todo: 18.09.2020 - remove this when block entities are transmitted in the ChunkData packet - 12xx12
@@ -3217,6 +3219,18 @@ void cProtocol_1_8_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<const cBannerEntity &>(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<Int32>(BannerEntity.GetBaseColor()));
+ break;
+ }
+
case E_BLOCK_BEACON:
{
auto & BeaconEntity = static_cast<const cBeaconEntity &>(a_BlockEntity);
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<const cBannerEntity &>(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<Int32>(BannerEntity.GetBaseColor()));
+ break;
+ }
+
case E_BLOCK_BEACON:
{
auto & BeaconEntity = static_cast<const cBeaconEntity &>(a_BlockEntity);