diff options
author | Alexander Harkness <me@bearbin.net> | 2024-11-04 23:28:57 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2024-11-04 23:28:57 +0100 |
commit | 09ab9dba1b46f1731276d3fd818293590e3e6e59 (patch) | |
tree | 06613303f5500224b04cc68cfb05cebd96d9cabe /src/Protocol | |
parent | Count non-air blocks and use the real count not 4096. (diff) | |
parent | Temp fix for disappearing chunk sections in 1.14 (#5560) (diff) | |
download | cuberite-09ab9dba1b46f1731276d3fd818293590e3e6e59.tar cuberite-09ab9dba1b46f1731276d3fd818293590e3e6e59.tar.gz cuberite-09ab9dba1b46f1731276d3fd818293590e3e6e59.tar.bz2 cuberite-09ab9dba1b46f1731276d3fd818293590e3e6e59.tar.lz cuberite-09ab9dba1b46f1731276d3fd818293590e3e6e59.tar.xz cuberite-09ab9dba1b46f1731276d3fd818293590e3e6e59.tar.zst cuberite-09ab9dba1b46f1731276d3fd818293590e3e6e59.zip |
Diffstat (limited to 'src/Protocol')
-rw-r--r-- | src/Protocol/Protocol_1_13.cpp | 6 | ||||
-rw-r--r-- | src/Protocol/Protocol_1_14.cpp | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/Protocol/Protocol_1_13.cpp b/src/Protocol/Protocol_1_13.cpp index eb452ec79..8bffe0f85 100644 --- a/src/Protocol/Protocol_1_13.cpp +++ b/src/Protocol/Protocol_1_13.cpp @@ -900,7 +900,11 @@ void cProtocol_1_13::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_ case cEntity::etItemFrame: { - // TODO + const auto & Frame = static_cast<const cItemFrame &>(a_Entity); + WriteEntityMetadata(a_Pkt, EntityMetadata::ItemFrameItem, EntityMetadataType::Item); + WriteItem(a_Pkt, Frame.GetItem()); + WriteEntityMetadata(a_Pkt, EntityMetadata::ItemFrameRotation, EntityMetadataType::VarInt); + a_Pkt.WriteVarInt32(Frame.GetItemRotation()); break; } // case etItemFrame diff --git a/src/Protocol/Protocol_1_14.cpp b/src/Protocol/Protocol_1_14.cpp index 4b306a2c3..beb929ce3 100644 --- a/src/Protocol/Protocol_1_14.cpp +++ b/src/Protocol/Protocol_1_14.cpp @@ -19,6 +19,7 @@ Implements the 1.14 protocol classes: #include "../BlockEntities/BlockEntity.h" #include "../Entities/ArrowEntity.h" +#include "../Entities/ItemFrame.h" #include "../Mobs/Bat.h" #include "../Entities/Boat.h" #include "../Mobs/Chicken.h" @@ -1213,7 +1214,11 @@ void cProtocol_1_14::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_ case cEntity::etItemFrame: { - // TODO + const auto & Frame = static_cast<const cItemFrame &>(a_Entity); + WriteEntityMetadata(a_Pkt, EntityMetadata::ItemFrameItem, EntityMetadataType::Item); + WriteItem(a_Pkt, Frame.GetItem()); + WriteEntityMetadata(a_Pkt, EntityMetadata::ItemFrameRotation, EntityMetadataType::VarInt); + a_Pkt.WriteVarInt32(Frame.GetItemRotation()); break; } // case etItemFrame |