Skip to content

Commit

Permalink
Merge pull request #20 from marioCST/feat/1.21.60
Browse files Browse the repository at this point in the history
Initial 1.21.6X update
  • Loading branch information
Plextora authored Feb 15, 2025
2 parents 9eda480 + 18456ad commit 3cac6eb
Show file tree
Hide file tree
Showing 24 changed files with 109 additions and 70 deletions.
17 changes: 9 additions & 8 deletions src/client/Latite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ DWORD __stdcall startThread(HINSTANCE dll) {
int deadCount = 0;

std::unordered_map<std::string, SDK::Version> versNumMap = {
{ "1.21.51", SDK::VLATEST},
{ "1.21.50", SDK::VLATEST},
//{ "1.21.44", SDK::V1_21_40},
//{ "1.21.43", SDK::V1_21_40},
//{ "1.21.41", SDK::V1_21_40},
//{ "1.21.40", SDK::V1_21_40},
{ "1.21.60", SDK::VLATEST },
//{ "1.21.51", SDK::V1_21_50 },
//{ "1.21.50", SDK::V1_21_50 },
//{ "1.21.44", SDK::V1_21_40 },
//{ "1.21.43", SDK::V1_21_40 },
//{ "1.21.41", SDK::V1_21_40 },
//{ "1.21.40", SDK::V1_21_40 },
//{ "1.21.30", SDK::V1_21_30 },
//{ "1.21.31", SDK::V1_21_30 }
//{ "1.21.20", SDK::V1_21_20 },
Expand Down Expand Up @@ -199,7 +200,6 @@ DWORD __stdcall startThread(HINSTANCE dll) {
MVSIG(ClientInstance_releaseCursor),
MVSIG(Level_tick),
MVSIG(ChatScreenController_sendChatMessage),
MVSIG(GameRenderer__renderCurrentFrame),
MVSIG(onClick),
MVSIG(MinecraftGame_onDeviceLost),
MVSIG(MinecraftGame_onAppSuspended),
Expand Down Expand Up @@ -247,7 +247,8 @@ DWORD __stdcall startThread(HINSTANCE dll) {
MVSIG(_updatePlayer),
MVSIG(GameArguments__onUri),
MVSIG(_bobHurt),
MVSIG(RenderMaterialGroup__common)
MVSIG(RenderMaterialGroup__common),
MVSIG(GuiData_displayClientMessage)
};

new (configMgrBuf) ConfigManager();
Expand Down
2 changes: 1 addition & 1 deletion src/client/hook/impl/GeneralHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ Color* GenericHooks::hkGetFogColor(SDK::Dimension* obj, Color* out, SDK::Actor*

void GenericHooks::hkAddMessage(SDK::GuiData* obj, void* msg, uint32_t profanityContext) {
// MessageContext
std::string& str = util::directAccess<std::string>(msg, 0x28);
std::string& str = util::directAccess<std::string>(msg, 0x8);

ChatMessageEvent ev{ str };
if (Eventing::get().dispatch(ev)) {
Expand Down
4 changes: 2 additions & 2 deletions src/client/misc/ClientMessageQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void ClientMessageQueue::doPrint(int numMessages) {
LatiteClientMessageEvent ev{ msg };
Eventing::get().dispatch(ev);

lp->displayClientMessage(msg);
cInst->getGuiData()->displayClientMessage(std::string(msg)); // new string has to be created as it crashes otherwise
messages.erase(it);
continue;
}
Expand All @@ -43,7 +43,7 @@ void ClientMessageQueue::display(std::string const& message) {
if (lp) {
LatiteClientMessageEvent ev{ message };
Eventing::get().dispatch(ev);
lp->displayClientMessage(message);
cInst->getGuiData()->displayClientMessage(message);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/script/class/impl/game/JsBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class JsBlock : public JsWrapperClass<SDK::Block> {

if (block->legacyBlock) {
Chakra::SetPropertyString(obj, L"name", util::StrToWStr(block->legacyBlock->namespacedId.string));
Chakra::SetPropertyString(obj, L"translateName", util::StrToWStr(block->legacyBlock->translateName.getString()));
Chakra::SetPropertyString(obj, L"translateName", util::StrToWStr(block->legacyBlock->translateName));
}
else {
Chakra::SetPropertyString(obj, L"name", L"air");
Expand Down
28 changes: 28 additions & 0 deletions src/sdk/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,34 @@ namespace util {
}

namespace SDK {
template <int offs_1_21_60, int offs_1_21_50, int offs_1_21_40, int offs_1_21_30, int offs_1_21_20, int offs_1_20_50, int offs_1_20_40, int offs_1_20_30, int offs_1_18_12, int offs_1_19_51>
extern inline const int mvGetOffset() {
switch (SDK::internalVers) {
case SDK::V1_21_60:
default:
return offs_1_21_60;
case SDK::V1_21_50:
return offs_1_21_50;
case SDK::V1_21_40:
return offs_1_21_40;
case SDK::V1_21_30:
return offs_1_21_30;
case SDK::V1_21_20:
return offs_1_21_20;
case SDK::V1_20_50:
return offs_1_20_50;
case SDK::V1_20_40:
return offs_1_20_40;
case SDK::V1_20_30:
return offs_1_20_30;
case SDK::V1_19_51:
return offs_1_19_51;
break;
case SDK::V1_18_12:
return offs_1_18_12;
}
}

template <int offs_1_21_50, int offs_1_21_40, int offs_1_21_30, int offs_1_21_20, int offs_1_20_50, int offs_1_20_40, int offs_1_20_30, int offs_1_18_12, int offs_1_19_51>
extern inline const int mvGetOffset() {
switch (SDK::internalVers) {
Expand Down
3 changes: 2 additions & 1 deletion src/sdk/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace SDK {
V1_21_30 = 12130,
V1_21_40 = 12140,
V1_21_50 = 12150,
VLATEST = V1_21_50,
V1_21_60 = 12160,
VLATEST = V1_21_60,
};

extern int internalVers;
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/common/client/game/FontRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace SDK {
class FontRepository {
public:
MVCLASS_FIELD(std::vector<std::shared_ptr<class Font>>, fontList, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x20);
MVCLASS_FIELD(std::vector<std::shared_ptr<class Font>>, fontList, 0x40, 0x30, 0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x20);

class Font* getSmoothFont() {
return fontList[7].get();
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/common/client/game/MinecraftGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bool SDK::MinecraftGame::isCursorGrabbed() {

SDK::ClientInstance* SDK::MinecraftGame::getPrimaryClientInstance() {
if (SDK::internalVers >= V1_21_40) {
const auto map = reinterpret_cast<std::map<unsigned char, std::shared_ptr<SDK::ClientInstance>>*>(reinterpret_cast<uintptr_t>(this) + 0x938);
const auto map = reinterpret_cast<std::map<unsigned char, std::shared_ptr<SDK::ClientInstance>>*>(reinterpret_cast<uintptr_t>(this) + 0x898);
return map->at(0).get();
}
//19AAAB62768
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/common/client/game/MinecraftGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ namespace SDK {

MVCLASS_FIELD(std::string, xuid, 0x310, 0x320, 0x318, 0x318, 0x2F8, 0x618, 0x228);
private:
MVCLASS_FIELD(class FontRepository**, fontRepo, 0xEB0, 0xDE0, 0xE08, 0xE00, 0xF60, 0xF30, 0xF20, 0x110, 0xF88);
MVCLASS_FIELD(class FontRepository**, fontRepo, 0xE08, 0xEB0, 0xDE0, 0xE08, 0xE00, 0xF60, 0xF30, 0xF20, 0x110, 0xF88);
public:
MVCLASS_FIELD(class Font*, minecraftFont, 0xEB8, 0xDE8, 0xE18, 0xE10, 0xF70, 0xF40, 0xF30, 0x120, 0xF78);
MVCLASS_FIELD(class Font*, minecraftFont, 0xE10, 0xEB8, 0xDE8, 0xE18, 0xE10, 0xF70, 0xF40, 0xF30, 0x120, 0xF78);

class FontRepository* getFontRepository() {
if (internalVers >= V1_21_40) {
Expand Down
15 changes: 11 additions & 4 deletions src/sdk/common/client/gui/GuiData.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@
namespace SDK {
class GuiData {
public:
MVCLASS_FIELD(Vec2, screenSize, 0x30, 0x18, 0x30);
MVCLASS_FIELD(Vec2, guiSize, 0x40, 0x28, 0x40);
MVCLASS_FIELD(float, guiScale, 0x4C, 0x34, 0x4C);
MVCLASS_FIELD(float, guiScaleFrac, 0x50, 0x38, 0x50);
MVCLASS_FIELD(Vec2, screenSize, 0x40, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x30);
MVCLASS_FIELD(Vec2, guiSize, 0x50, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x28, 0x40);
MVCLASS_FIELD(float, guiScale, 0x5C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x34, 0x4C);
MVCLASS_FIELD(float, guiScaleFrac, 0x60, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x38, 0x50);

void updateGuiScale(float newScale) {
guiScale = newScale;
guiScaleFrac = 1.f / newScale;
guiSize = Vec2((screenSize.x * guiScaleFrac), screenSize.y * guiScaleFrac);
}

void displayClientMessage(const std::string& message) {
static auto sig = Signatures::GuiData_displayClientMessage.result;
using func_t = void(*)(GuiData*, const std::string&, std::optional<std::string>, bool);
static auto func = reinterpret_cast<func_t>(sig);
func(this, message, {}, false);
}
};
}
2 changes: 1 addition & 1 deletion src/sdk/common/client/renderer/game/LevelRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SDK {
class LevelRenderer {
MVCLASS_FIELD(LevelRendererPlayer*, levelRendererPlayer, 0x318, 0x308, 0x308, 0x308, 0x308, 0x308, 0x288, 0x2A8);
MVCLASS_FIELD(LevelRendererPlayer*, levelRendererPlayer, 0x328, 0x318, 0x318, 0x308, 0x308, 0x308, 0x308, 0x308, 0x288, 0x2A8);
public:
LevelRendererPlayer* getLevelRendererPlayer() {
if (SDK::internalVers <= V1_19_51 /*1.20+*/) {
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/common/client/renderer/game/LevelRendererPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Vec3& SDK::LevelRendererPlayer::getOrigin() {
}

float& SDK::LevelRendererPlayer::getFovX() {
if (SDK::internalVers >= SDK::V1_21_60) return util::directAccess<float>(this, 0xEC8);
if (SDK::internalVers >= SDK::V1_21_50) return util::directAccess<float>(this, 0xED0);
if (SDK::internalVers >= SDK::V1_21_40) return util::directAccess<float>(this, 0xED8);
if (SDK::internalVers >= SDK::V1_21_30) return util::directAccess<float>(this, 0xE28);
Expand All @@ -23,6 +24,7 @@ float& SDK::LevelRendererPlayer::getFovX() {
}

float& SDK::LevelRendererPlayer::getFovY() {
if (SDK::internalVers >= SDK::V1_21_60) return util::directAccess<float>(this, 0xEDC);
if (SDK::internalVers >= SDK::V1_21_50) return util::directAccess<float>(this, 0xEE4);
if (SDK::internalVers >= SDK::V1_21_40) return util::directAccess<float>(this, 0xEEC);
if (SDK::internalVers >= SDK::V1_21_30) return util::directAccess<float>(this, 0xE3C);
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/common/world/Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SDK {
class AttributeInstance {
public:
// AttributeInstance::getCurrentValue
MVCLASS_FIELD(float, value, 0x84, 0x88, 0x84, 0x84, 0x84);
MVCLASS_FIELD(float, value, 0x7C, 0x84, 0x84, 0x84, 0x84, 0x84, 0x88, 0x84, 0x84, 0x84);
};

class Attribute {
Expand Down
10 changes: 5 additions & 5 deletions src/sdk/common/world/Item.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
namespace SDK {
class Item {
public:
std::string atlas; // atlas.items
CLASS_FIELD(std::string, translateName, 0xA8); // item.bow
CLASS_FIELD(HashedString, id, 0xC8); // bow
CLASS_FIELD(HashedString, _namespace, 0xF0); // minecraft
CLASS_FIELD(HashedString, namespacedId, 0x118); // minecraft:bow
CLASS_FIELD(std::string, atlas, 0x10); // atlas.items
CLASS_FIELD(std::string, translateName, 0xB0); // item.bow
CLASS_FIELD(HashedString, id, 0xD0); // bow
CLASS_FIELD(std::string, _namespace, 0x100); // minecraft
CLASS_FIELD(HashedString, namespacedId, 0x120); // minecraft:bow

int getMaxUseDuration(class ItemStackBase* item) {
if (internalVers >= V1_20_50) {
Expand Down
14 changes: 7 additions & 7 deletions src/sdk/common/world/Weather.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ namespace SDK {
char pad_0008[40]; //0x0008
public:
struct WeatherData {
float rainTransitionOld; //0x0034
float rainTransition; //0x0038
float rain; //0x003C
float thunderTransitionOld; //0x0040
float thunderTransition; //0x0044
float thunder; //0x0048
float skyDarkness; //0x004C
float rainTransitionOld{}; //0x0034
float rainTransition{}; //0x0038
float rain{}; //0x003C
float thunderTransitionOld{}; //0x0040
float thunderTransition{}; //0x0044
float thunder{}; //0x0048
float skyDarkness{}; //0x004C

WeatherData() = default;
};
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/common/world/actor/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Vec3& SDK::Actor::getPosOld() {

int SDK::Actor::getCommandPermissionLevel() {
// @dump-wbds vtable Actor, getCommandPermissionLevel
return memory::callVirtual<int>(this, mvGetOffset<0x69, 0x6A, 0x6B, 0x6B, 0x6D, 0x7C, 0xB5, 0xCC, 0xCD>());
return memory::callVirtual<int>(this, mvGetOffset<0x67, 0x69, 0x6A, 0x6B, 0x6B, 0x6D, 0x7C, 0xB5, 0xCC, 0xCD>());
}

int64_t SDK::Actor::getRuntimeID() {
Expand All @@ -94,7 +94,7 @@ uint8_t SDK::Actor::getEntityTypeID() {

void SDK::Actor::swing() {
// @dump-wbds vtable Actor, swing
return memory::callVirtual<void>(this, SDK::mvGetOffset<0x71, 0x72, 0x73, 0x73, 0x75, 0x86, 0xC4, 0xDB, 0xDC>());
return memory::callVirtual<void>(this, SDK::mvGetOffset<0x6F, 0x71, 0x72, 0x73, 0x73, 0x75, 0x86, 0xC4, 0xDB, 0xDC>());
}

bool SDK::Actor::isPlayer() {
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/common/world/actor/Mob.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace SDK {
class Mob : public Actor {
public:
void setSprinting(bool b) {
memory::callVirtual<void>(this, SDK::mvGetOffset<0x91, 0x92, 0x96, 0x96, 0x99, 0xAF, 0xFB, 0x115, 0x11C>(), b);
memory::callVirtual<void>(this, SDK::mvGetOffset<0x8C, 0x91, 0x92, 0x96, 0x96, 0x99, 0xAF, 0xFB, 0x115, 0x11C>(), b);
}

int getItemUseDuration() {
return memory::callVirtual<int>(this, SDK::mvGetOffset<0x9A, 0x9B, 0x9F, 0x9F, 0xA2, 0xB9, 0x109, 0x12A, 0x12F>());
return memory::callVirtual<int>(this, SDK::mvGetOffset<0x95, 0x9A, 0x9B, 0x9F, 0x9F, 0xA2, 0xB9, 0x109, 0x12A, 0x12F>());
}
};
}
4 changes: 2 additions & 2 deletions src/sdk/common/world/actor/player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
void SDK::Player::displayClientMessage(std::string const& message) {
if (internalVers >= V1_21_20) {
std::optional<std::string> opt = {};
memory::callVirtual<void>(this, mvGetOffset<0xCD, 0xCE, 0xD2, 0xD2, 0x0, 0x0, 0x0, 0x0, 0x0>(), message, opt);
memory::callVirtual<void>(this, mvGetOffset<0xC8, 0xCD, 0xCE, 0xD2, 0xD2, 0x0, 0x0, 0x0, 0x0, 0x0>(), message, opt);
return;
}
memory::callVirtual<void>(this, mvGetOffset<0xEF, 0x15E, 0x184, 0x18A>(), message);
Expand All @@ -34,5 +34,5 @@ SDK::MoveInputComponent* SDK::Player::getMoveInputComponent() {
}

std::string SDK::Player::getXUID() {
return memory::callVirtual<std::string>(this, SDK::mvGetOffset<0xF1, 0xF2, 0xF3, 0xF3, 0xF6, 0x18C, 0x1B6, 0x1BC>());
return memory::callVirtual<std::string>(this, SDK::mvGetOffset<0xEC, 0xF1, 0xF2, 0xF3, 0xF3, 0xF6, 0x18C, 0x1B6, 0x1BC>());
}
8 changes: 4 additions & 4 deletions src/sdk/common/world/actor/player/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ namespace SDK {
std::string getXUID();

// @dump-wbds Player::getSupplies, 3
MVCLASS_FIELD(PlayerInventory*, supplies, 0x5D0, 0x628, 0x760, 0x7C0, 0x7C0, 0xB70, 0xDB8); // xref: getSupplies
MVCLASS_FIELD(PlayerInventory*, supplies, 0x5C8, 0x5D0, 0x5D0, 0x5D0, 0x628, 0x760, 0x7C0, 0x7C0, 0xB70, 0xDB8); // xref: getSupplies
// @dump-wbds Player::getGameMode, 3
MVCLASS_FIELD(GameMode*, gameMode, 0xB18, 0xB28, 0xB18, 0xB00, 0xEC8, 0xEB0, 0xE70, 0x1238, 0x1670); // xref: getGameMode
MVCLASS_FIELD(GameMode*, gameMode, 0xAD8, 0xB18, 0xB28, 0xB18, 0xB00, 0xEC8, 0xEB0, 0xE70, 0x1238, 0x1670); // xref: getGameMode
// @dump-wbds Player::getName, 3
MVCLASS_FIELD(std::string, playerName, 0xCA0, 0xCB0, 0xCA0, 0xC88, 0x1D30, 0x1CB8, 0x1C78, 0x8C0, 0x2478); // xref: getName
MVCLASS_FIELD(std::string, playerName, 0xC58, 0xCA0, 0xCB0, 0xCA0, 0xC88, 0x1D30, 0x1CB8, 0x1C78, 0x8C0, 0x2478); // xref: getName
// @dump-wbds ServerPlayer::sendNetworkPacket, 18
MVCLASS_FIELD(PacketSender*, packetSender, 0x848, 0x898, 0x890, 0x890, 0xC48, 0xC70, 0xC70, 0x1020, 0x1438); // xref: Player::Player a3
MVCLASS_FIELD(PacketSender*, packetSender, 0x7E0, 0x848, 0x898, 0x890, 0x890, 0xC48, 0xC70, 0xC70, 0x1020, 0x1438); // xref: Player::Player a3
};
}
2 changes: 1 addition & 1 deletion src/sdk/common/world/level/Dimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SDK {
public:
CLASS_FIELD(std::string, dimensionName, 0x20); // reclass
CLASS_FIELD(class BlockSource*, region, 0xC0); // xref: Actor::getBlockSource something like that
CLASS_FIELD(class Weather*, weather, 0x1B0);
CLASS_FIELD(class Weather*, weather, 0x1C8);
CLASS_FIELD(class VillageManager*, villageManager, 0x588); // xref: getVillageManager
};
}
12 changes: 6 additions & 6 deletions src/sdk/common/world/level/Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#include "Level.h"

void SDK::Level::playSoundEvent(std::string const& text, Vec3 const& pos, float vol, float pitch) {
static int index = mvGetOffset<0xB2, 0xA2, 0xA2, 0xA2, 0xA3, 0xA3, 0xBD, 0xC9>();
static int index = mvGetOffset<0xB3, 0xB2, 0xB2, 0xA2, 0xA2, 0xA2, 0xA3, 0xA3, 0xBD, 0xC9>();
memory::callVirtual<void>(this, index, text, pos, vol, pitch);
}

std::vector<SDK::Actor*> SDK::Level::getRuntimeActorList() {
std::vector<Actor*> list;
static int index = mvGetOffset<0x132, 0x134, 0x117, 0x117, 0x116, 0x125, 0x125, 0x12D, 0x13C>();
static int index = mvGetOffset<0x134, 0x132, 0x134, 0x117, 0x117, 0x116, 0x125, 0x125, 0x12D, 0x13C>();

// TODO: this might return a vector too?
memory::callVirtual<void, std::vector<Actor*>&>(this, index, list);
Expand All @@ -17,25 +17,25 @@ std::vector<SDK::Actor*> SDK::Level::getRuntimeActorList() {

std::unordered_map<UUID, SDK::PlayerListEntry>* SDK::Level::getPlayerList() {
if (internalVers >= SDK::V1_21_40) {
return *reinterpret_cast<std::unordered_map<UUID, SDK::PlayerListEntry>**>(reinterpret_cast<uintptr_t>(this) + 0xBF0);
return *reinterpret_cast<std::unordered_map<UUID, SDK::PlayerListEntry>**>(reinterpret_cast<uintptr_t>(this) + 0xB68);
}

static int index = SDK::mvGetOffset<0x112, 0x111, 0x120, 0x120, 0x128, 0x137>();
return memory::callVirtual<std::unordered_map<UUID, SDK::PlayerListEntry>*>(this, index);
}

SDK::HitResult* SDK::Level::getHitResult() {
static int index = mvGetOffset<0x13C, 0x13E, 0x121, 0x121, 0x120, 0x12E, 0x12E, 0x139, 0x148>();
static int index = mvGetOffset<0x13E, 0x13C, 0x13E, 0x121, 0x121, 0x120, 0x12E, 0x12E, 0x139, 0x148>();
return memory::callVirtual<HitResult*>(this, index);
}

SDK::HitResult* SDK::Level::getLiquidHitResult() {
static int index = mvGetOffset<0x13D, 0x13F, 0x122, 0x122, 0x121, 0x12F, 0x12F, 0x13A, 0x149>();
static int index = mvGetOffset<0x13F, 0x13D, 0x13F, 0x122, 0x122, 0x121, 0x12F, 0x12F, 0x13A, 0x149>();
return reinterpret_cast<SDK::HitResult*>(memory::callVirtual<uintptr_t>(this, index)) /*sizeof hitResult (0x60) / 8*/;
}

bool SDK::Level::isClientSide() {
return memory::callVirtual<bool>(this, SDK::mvGetOffset<0x12B, 0x12C, 0x111, 0x111, 0x110, 0x11F, 0x11F, 0x12B, 0x127>());
return memory::callVirtual<bool>(this, SDK::mvGetOffset<0x12D, 0x12B, 0x12C, 0x111, 0x111, 0x110, 0x11F, 0x11F, 0x12B, 0x127>());
}

const std::string& SDK::Level::getLevelName() {
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/common/world/level/LevelData.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

class LevelData {
public:
MVCLASS_FIELD(std::string, levelName, 0x390);
MVCLASS_FIELD(std::string, levelName, 0x370);
};
4 changes: 2 additions & 2 deletions src/sdk/common/world/level/block/BlockLegacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace SDK {
class BlockLegacy {
public:
CLASS_FIELD(FNVString, translateName, 0x60); // tile.deepslate_diamond_ore
CLASS_FIELD(std::string, translateName, 0x8); // tile.deepslate_diamond_ore
CLASS_FIELD(FNVString, name, 0x90); // deepslate_diamond_ore
CLASS_FIELD(std::string, Namespace, 0xC0); // minecraft
CLASS_FIELD(FNVString, namespacedId, 0xE0); // minecraft:deepslate_diamond_ore
CLASS_FIELD(std::string, itemGroup, 0x180); // itemGroup.name.ore
CLASS_FIELD(std::string, itemGroup, 0x178); // itemGroup.name.ore
private:
virtual ~BlockLegacy() = 0;
};
Expand Down
Loading

0 comments on commit 3cac6eb

Please sign in to comment.