summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol/Protocol_1_8.cpp')
-rw-r--r--src/Protocol/Protocol_1_8.cpp40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 1c98d83f3..c6b21fc3d 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -43,6 +43,7 @@ Implements the 1.8 protocol classes:
#include "../BlockEntities/BeaconEntity.h"
#include "../BlockEntities/CommandBlockEntity.h"
+#include "../BlockEntities/EnchantingTableEntity.h"
#include "../BlockEntities/MobHeadEntity.h"
#include "../BlockEntities/MobSpawnerEntity.h"
#include "../BlockEntities/FlowerPotEntity.h"
@@ -1529,12 +1530,16 @@ 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_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
+
default: ASSERT(!"Unhandled or unimplemented BlockEntity update request!"); break;
}
Pkt.WriteBEUInt8(Action);
@@ -3395,6 +3400,29 @@ void cProtocol_1_8_0::WriteBlockEntity(cPacketizer & a_Pkt, const cBlockEntity &
break;
}
+ case E_BLOCK_ENCHANTMENT_TABLE:
+ {
+ auto & EnchantingTableEntity = static_cast<const cEnchantingTableEntity &>(a_BlockEntity);
+ Writer.AddInt("x", EnchantingTableEntity.GetPosX());
+ Writer.AddInt("y", EnchantingTableEntity.GetPosY());
+ Writer.AddInt("z", EnchantingTableEntity.GetPosZ());
+ if (!EnchantingTableEntity.GetCustomName().empty())
+ {
+ Writer.AddString("CustomName", EnchantingTableEntity.GetCustomName());
+ }
+ Writer.AddString("id", "EnchantingTable");
+ break;
+ }
+
+ case E_BLOCK_END_PORTAL:
+ {
+ Writer.AddInt("x", a_BlockEntity.GetPosX());
+ Writer.AddInt("y", a_BlockEntity.GetPosY());
+ Writer.AddInt("z", a_BlockEntity.GetPosZ());
+ Writer.AddString("id", "EndPortal");
+ break;
+ }
+
case E_BLOCK_HEAD:
{
auto & MobHeadEntity = static_cast<const cMobHeadEntity &>(a_BlockEntity);