diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-04-10 16:57:16 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2021-04-12 23:35:07 +0200 |
commit | a999c5d845bd759c6d83b356c7b39e67473dc452 (patch) | |
tree | c8da72f5192293648f30b3228e7563fa7c79d13e /src/Protocol/Protocol_1_13.h | |
parent | Add animations for shield/item block & break (diff) | |
download | cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.gz cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.bz2 cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.lz cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.xz cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.tar.zst cuberite-a999c5d845bd759c6d83b356c7b39e67473dc452.zip |
Diffstat (limited to 'src/Protocol/Protocol_1_13.h')
-rw-r--r-- | src/Protocol/Protocol_1_13.h | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/src/Protocol/Protocol_1_13.h b/src/Protocol/Protocol_1_13.h index 53de8bbc1..970625877 100644 --- a/src/Protocol/Protocol_1_13.h +++ b/src/Protocol/Protocol_1_13.h @@ -46,33 +46,26 @@ protected: virtual void SendTabCompletionResults (const AStringVector & a_Results) override; virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override; - /** Translates outgoing packet types. */ - virtual UInt32 GetPacketID(ePacketType a_PacketType) override; - + virtual UInt8 GetEntityMetadataID(EntityMetadata a_Metadata) const; + virtual UInt8 GetEntityMetadataID(EntityMetadataType a_FieldType) const; + virtual std::pair<short, short> GetItemFromProtocolID(UInt32 a_ProtocolID) const; + virtual UInt32 GetPacketID(ePacketType a_PacketType) const override; + virtual UInt32 GetProtocolBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) const; virtual signed char GetProtocolEntityStatus(EntityAnimation a_Animation) const override; - - /** Returns 1.13. */ - virtual Version GetProtocolVersion() override; - - /** Converts eMonsterType to protocol-specific mob types */ - virtual UInt32 GetProtocolMobType(eMonsterType a_MobType) override; - - virtual UInt8 GetEntityMetadataID(EntityMetadata a_Metadata); - virtual UInt8 GetEntityMetadataID(EntityMetadataType a_FieldType); - virtual std::pair<short, short> GetItemFromProtocolID(UInt32 a_ProtocolID); - virtual UInt32 GetProtocolBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta); - virtual UInt32 GetProtocolItemType(short a_ItemID, short a_ItemDamage); - virtual UInt32 GetProtocolStatisticType(Statistic a_Statistic); + virtual UInt32 GetProtocolItemType(short a_ItemID, short a_ItemDamage) const; + virtual UInt32 GetProtocolMobType(eMonsterType a_MobType) const override; + virtual UInt32 GetProtocolStatisticType(Statistic a_Statistic) const; + virtual Version GetProtocolVersion() const override; virtual bool HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) override; virtual void HandlePacketPluginMessage(cByteBuffer & a_ByteBuffer) override; virtual void HandlePacketSetBeaconEffect(cByteBuffer & a_ByteBuffer); - virtual bool ReadItem(cByteBuffer & a_ByteBuffer, cItem & a_Item, size_t a_KeepRemainingBytes) override; - virtual void WriteItem(cPacketizer & a_Pkt, const cItem & a_Item) override; - virtual void WriteEntityMetadata(cPacketizer & a_Pkt, EntityMetadata a_Metadata, EntityMetadataType a_FieldType); - virtual void WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_Entity) override; - virtual void WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) override; + virtual bool ReadItem(cByteBuffer & a_ByteBuffer, cItem & a_Item, size_t a_KeepRemainingBytes) const override; + virtual void WriteEntityMetadata(cPacketizer & a_Pkt, EntityMetadata a_Metadata, EntityMetadataType a_FieldType) const; + virtual void WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_Entity) const override; + virtual void WriteItem(cPacketizer & a_Pkt, const cItem & a_Item) const override; + virtual void WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_Mob) const override; }; @@ -93,11 +86,11 @@ protected: virtual void SendBossBarAdd(UInt32 a_UniqueID, const cCompositeChat & a_Title, float a_FractionFilled, BossBarColor a_Color, BossBarDivisionType a_DivisionType, bool a_DarkenSky, bool a_PlayEndMusic, bool a_CreateFog) override; virtual void SendBossBarUpdateFlags(UInt32 a_UniqueID, bool a_DarkenSky, bool a_PlayEndMusic, bool a_CreateFog) override; - virtual Version GetProtocolVersion() override; - virtual std::pair<short, short> GetItemFromProtocolID(UInt32 a_ProtocolID) override; - virtual UInt32 GetProtocolBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) override; - virtual UInt32 GetProtocolItemType(short a_ItemID, short a_ItemDamage) override; - virtual UInt32 GetProtocolStatisticType(Statistic a_Statistic) override; + virtual std::pair<short, short> GetItemFromProtocolID(UInt32 a_ProtocolID) const override; + virtual UInt32 GetProtocolBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) const override; + virtual UInt32 GetProtocolItemType(short a_ItemID, short a_ItemDamage) const override; + virtual UInt32 GetProtocolStatisticType(Statistic a_Statistic) const override; + virtual Version GetProtocolVersion() const override; }; @@ -115,7 +108,7 @@ public: protected: - virtual Version GetProtocolVersion() override; - virtual bool ReadItem(cByteBuffer & a_ByteBuffer, cItem & a_Item, size_t a_KeepRemainingBytes) override; - virtual void WriteItem(cPacketizer & a_Pkt, const cItem & a_Item) override; + virtual Version GetProtocolVersion() const override; + virtual bool ReadItem(cByteBuffer & a_ByteBuffer, cItem & a_Item, size_t a_KeepRemainingBytes) const override; + virtual void WriteItem(cPacketizer & a_Pkt, const cItem & a_Item) const override; }; |