diff --git a/LiteLoader/include/llapi/mc/HitResult.hpp b/LiteLoader/include/llapi/mc/HitResult.hpp index ead0658..9b3e460 100644 --- a/LiteLoader/include/llapi/mc/HitResult.hpp +++ b/LiteLoader/include/llapi/mc/HitResult.hpp @@ -9,10 +9,10 @@ class StackResultStorageEntity; enum class HitResultType:int { - TILE=0, - ENTITY, - ENTITY_OUT_OF_RANGE, - NO_HIT, + TILE = 0, + ENTITY = 0x1, + ENTITY_OUT_OF_RANGE = 0x2, + NO_HIT = 0x3, }; #undef BEFORE_EXTRA @@ -22,7 +22,6 @@ class HitResult { #define AFTER_EXTRA // Add Member There - //char filler[112]; Vec3 startPos; //0 Vec3 rayDir; //12 HitResultType type; //24 @@ -30,20 +29,17 @@ class HitResult { BlockPos endBpos; //32 Vec3 endPos; //44 uintptr_t actorRef; //56 - uintptr_t unk64; - int unk72; - int unk76; //76 - bool hitLiquid; //80 - FaceID liquidFace; //81 - BlockPos liquidBpos; //84 - Vec3 liquidPos; //96 - bool indirectHit; //108 - //112 + bool mIsHitLiquid; //64 + FaceID liquidFace; //65 + BlockPos liquidBpos; //68 + Vec3 liquidPos; //80 + bool indirectHit; //92 public: - inline bool __fastcall isHit() { - return (unsigned int)(*((int*)this + 6) - 2) > 1; + inline bool isHit() { + return (unsigned int)(this->type) > 3; } + LIAPI Actor* getEntity(); 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 622469b..5d53b52 100644 --- a/LiteLoader/src/llapi/mc/HitResultAPI.cpp +++ b/LiteLoader/src/llapi/mc/HitResultAPI.cpp @@ -1,5 +1,10 @@ #include #include +#include + +Actor* HitResult::getEntity() { + return (Actor*)this->actorRef; +} FaceID HitResult::getFacing() { return dAccess(this, ll::offset::HITRESULTAPI_getFacing);