From 07ffd9f6f3d6b0748b48ca37a550bf2a3c033c91 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 29 Aug 2020 16:47:40 +0100 Subject: [PATCH] Unused/duplicate function cleanup * FaceIntToBlockFace in 1.8/1.9 protocol merged - Removed undefined permissions stuff in Player header --- src/Entities/Player.h | 3 --- src/Protocol/Protocol_1_8.cpp | 2 +- src/Protocol/Protocol_1_8.h | 2 +- src/Protocol/Protocol_1_9.cpp | 20 -------------------- src/Protocol/Protocol_1_9.h | 4 ---- 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 6297ddcbc..ba219a84d 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -767,9 +767,6 @@ protected: /** Sets the speed and sends it to the client, so that they are forced to move so. */ virtual void DoSetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ) override; - void ResolvePermissions(void); - void ResolveGroups(void); - virtual void Destroyed(void) override; /** Filters out damage for creative mode / friendly fire */ diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp index ee72e14fb..39c20b6cf 100644 --- a/src/Protocol/Protocol_1_8.cpp +++ b/src/Protocol/Protocol_1_8.cpp @@ -3172,7 +3172,7 @@ void cProtocol_1_8_0::StartEncryption(const Byte * a_Key) -eBlockFace cProtocol_1_8_0::FaceIntToBlockFace(Int8 a_BlockFace) +eBlockFace cProtocol_1_8_0::FaceIntToBlockFace(const Int32 a_BlockFace) { // Normalize the blockface values returned from the protocol // Anything known gets mapped 1:1, everything else returns BLOCK_FACE_NONE diff --git a/src/Protocol/Protocol_1_8.h b/src/Protocol/Protocol_1_8.h index b813b16bf..f48ed4f9c 100644 --- a/src/Protocol/Protocol_1_8.h +++ b/src/Protocol/Protocol_1_8.h @@ -226,7 +226,7 @@ protected: /** Converts the BlockFace received by the protocol into eBlockFace constants. If the received value doesn't match any of our eBlockFace constants, BLOCK_FACE_NONE is returned. */ - eBlockFace FaceIntToBlockFace(Int8 a_FaceInt); + eBlockFace FaceIntToBlockFace(Int32 a_FaceInt); /** Sends the entity type and entity-dependent data required for the entity to initially spawn. */ virtual void SendEntitySpawn(const cEntity & a_Entity, const UInt8 a_ObjectType, const Int32 a_ObjectData); diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 3d34eeabe..b4fc47d0f 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -1233,26 +1233,6 @@ void cProtocol_1_9_0::ParseItemMetadata(cItem & a_Item, const AString & a_Metada -eBlockFace cProtocol_1_9_0::FaceIntToBlockFace(Int32 a_BlockFace) -{ - // Normalize the blockface values returned from the protocol - // Anything known gets mapped 1:1, everything else returns BLOCK_FACE_NONE - switch (a_BlockFace) - { - case BLOCK_FACE_XM: return BLOCK_FACE_XM; - case BLOCK_FACE_XP: return BLOCK_FACE_XP; - case BLOCK_FACE_YM: return BLOCK_FACE_YM; - case BLOCK_FACE_YP: return BLOCK_FACE_YP; - case BLOCK_FACE_ZM: return BLOCK_FACE_ZM; - case BLOCK_FACE_ZP: return BLOCK_FACE_ZP; - default: return BLOCK_FACE_NONE; - } -} - - - - - eHand cProtocol_1_9_0::HandIntToEnum(Int32 a_Hand) { // Convert hand parameter into eHand enum diff --git a/src/Protocol/Protocol_1_9.h b/src/Protocol/Protocol_1_9.h index e936710d7..5e444c4e1 100644 --- a/src/Protocol/Protocol_1_9.h +++ b/src/Protocol/Protocol_1_9.h @@ -97,10 +97,6 @@ protected: /** Parses item metadata as read by ReadItem(), into the item enchantments. */ virtual void ParseItemMetadata(cItem & a_Item, const AString & a_Metadata) override; - /** Converts the BlockFace received by the protocol into eBlockFace constants. - If the received value doesn't match any of our eBlockFace constants, BLOCK_FACE_NONE is returned. */ - eBlockFace FaceIntToBlockFace(Int32 a_FaceInt); - /** Converts the hand parameter received by the protocol into eHand constants. If the received value doesn't match any of the know value, raise an assertion fail or return hMain. */ eHand HandIntToEnum(Int32 a_Hand);