diff --git a/LiteLoader/Header/MC/Player.hpp b/LiteLoader/Header/MC/Player.hpp index fee59af..4293961 100644 --- a/LiteLoader/Header/MC/Player.hpp +++ b/LiteLoader/Header/MC/Player.hpp @@ -24,6 +24,9 @@ class Player : public Mob { #define AFTER_EXTRA // Add new members to class + // mClientUUID 2720 + // mCertificate 2736 + // mClientSubId 3520 public: enum PositionMode : char { NORMAL, @@ -34,8 +37,9 @@ public: LIAPI std::string getName(); LIAPI std::string getRealName(); - LIAPI std::string getUuid(); + LIAPI std::string getUuid()const; LIAPI std::string getXuid()const; + LIAPI mce::UUID getClientUUID()const; LIAPI unsigned char getClientSubId(); LIAPI string getDeviceTypeName(); LIAPI int getAvgPing(); diff --git a/LiteLoader/Kernel/MC/PlayerAPI.cpp b/LiteLoader/Kernel/MC/PlayerAPI.cpp index 4f55f66..0cc27cf 100644 --- a/LiteLoader/Kernel/MC/PlayerAPI.cpp +++ b/LiteLoader/Kernel/MC/PlayerAPI.cpp @@ -311,7 +311,7 @@ bool Player::refreshAttributes(std::vector const& attributes) return true; } -string Player::getUuid() { +string Player::getUuid() const{ auto result = ExtendedCertificate::getIdentity(*getCertificate()); return result.asString(); } @@ -320,6 +320,10 @@ string Player::getXuid() const{ return ExtendedCertificate::getXuid(*getCertificate()); } +mce::UUID Player::getClientUUID()const{ + return dAccess(this,2720); +}; + unsigned char Player::getClientSubId() { //ServerPlayer::sendNetworkPacket 参4 return dAccess(this,3520);