From bcf199e8d28041a24a7f8dcbe22262e6c063186d Mon Sep 17 00:00:00 2001 From: Qiuzhizhe <42761326+quizhizhe@users.noreply.github.com> Date: Mon, 20 Mar 2023 07:03:22 -0700 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3`HitResult::getEntity`?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LiteLoader/include/llapi/mc/HitResult.hpp | 8 +++++--- LiteLoader/src/llapi/mc/HitResultAPI.cpp | 5 ----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/LiteLoader/include/llapi/mc/HitResult.hpp b/LiteLoader/include/llapi/mc/HitResult.hpp index 9b3e460..47819c0 100644 --- a/LiteLoader/include/llapi/mc/HitResult.hpp +++ b/LiteLoader/include/llapi/mc/HitResult.hpp @@ -6,6 +6,7 @@ #define BEFORE_EXTRA // Include Headers or Declare Types Here +class Actor; class StackResultStorageEntity; enum class HitResultType:int { @@ -37,9 +38,10 @@ class HitResult { public: inline bool isHit() { return (unsigned int)(this->type) > 3; - } - - LIAPI Actor* getEntity(); + }; + inline Actor* getEntity() { + return (Actor*)(this->actorRef); + }; LIAPI FaceID getFacing(); LIAPI Vec3 getPos(); LIAPI bool isHitLiquid(); diff --git a/LiteLoader/src/llapi/mc/HitResultAPI.cpp b/LiteLoader/src/llapi/mc/HitResultAPI.cpp index 5d53b52..622469b 100644 --- a/LiteLoader/src/llapi/mc/HitResultAPI.cpp +++ b/LiteLoader/src/llapi/mc/HitResultAPI.cpp @@ -1,10 +1,5 @@ #include #include -#include - -Actor* HitResult::getEntity() { - return (Actor*)this->actorRef; -} FaceID HitResult::getFacing() { return dAccess(this, ll::offset::HITRESULTAPI_getFacing);