Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
Fix .nbt save command, Chest Stealer and Item Rendering (#4500)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloppyDolphin57 authored Sep 6, 2021
1 parent bcb9e6a commit 4551019
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Horion/Module/Modules/ChestStealer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void ChestStealer::chestScreenController_tick(C_ChestScreenController* c) {
} else {
delay++;
if (delay > setDelay) {
c->leaveScreen();
c->tryExit();
delay = 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Horion/Module/Modules/HudModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) {
}
}
{ // ArmorHUD
/*

if (!(g_Data.getLocalPlayer() == nullptr || !this->displayArmor || !GameData::canUseMoveKeys())) {
static float constexpr scale = 1.f;
static float constexpr opacity = 0.25f;
Expand All @@ -167,7 +167,7 @@ void HudModule::onPostRender(C_MinecraftUIRenderContext* renderCtx) {
//x += scale * spacing;
if (item->isValid())
DrawUtils::drawItem(item, vec2_t(x, y), opacity, scale, item->isEnchanted());
}*/
}
}
{ // Keystrokes
if (!(g_Data.getLocalPlayer() == nullptr || !this->keystrokes || !GameData::canUseMoveKeys())) {
Expand Down
2 changes: 1 addition & 1 deletion SDK/CInventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bool C_Inventory::isFull() {

void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name, int slot) {
using ContainerScreenController__autoPlace = __int64(__fastcall*)(C_ContainerScreenController*, uintptr_t, TextHolder, int);
static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast<ContainerScreenController__autoPlace>(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 07 4D 8B F9 4D 8B E8"));
static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast<ContainerScreenController__autoPlace>(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 30 ?? ?? ?? ?? ?? C4 48 89 45 ?? 45 8B E1 49 8B F0 44 8B EA 89 54 24 30 4C 8B F1"));

TextHolder txt = TextHolder(name);

Expand Down
4 changes: 3 additions & 1 deletion SDK/CInventory.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class C_PlayerInventoryProxy {
C_Inventory* inventory; //0x00B0
};

//Im not sure exactly where these unknown's go but the funcs we use work.
class C_ContainerScreenController {
private:
virtual __int64 destructor();
Expand All @@ -85,6 +86,7 @@ class C_ContainerScreenController {
virtual __int64 onTerminate(void);
virtual __int64 onInit(void);
virtual __int64 onDelete(void);
virtual __int64 unknown1();

public:
virtual bool canExit(void);
Expand All @@ -94,8 +96,8 @@ class C_ContainerScreenController {
virtual __int64 areControllerTabsEnabled(void);
virtual __int64 onCreation(void);
virtual __int64 logCreationTime(std::string const&, double, double, unsigned char);
virtual __int64 unknown1();
virtual __int64 unknown2();
virtual __int64 unknown3();

public:
virtual __int64 onLeave(void);
Expand Down
6 changes: 3 additions & 3 deletions SDK/CItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
C_BaseActorRenderContext::C_BaseActorRenderContext(C_ScreenContext *ScreenCtx, C_ClientInstance *client, MinecraftGame *game) {
memset(this, 0, sizeof(C_BaseActorRenderContext));
using BaseActorRenderContext_t = __int64(__fastcall *)(C_BaseActorRenderContext *, C_ScreenContext *, C_ClientInstance *, MinecraftGame *);
static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast<BaseActorRenderContext_t>(FindSignature("48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC ?? 48 8D 05 ?? ?? ?? ?? 8B EA 48 89 01 48 8B F9 48 8B 71 ?? 48 8B 59 30 48"));
static BaseActorRenderContext_t BaseActorRenderContext_constructor = reinterpret_cast<BaseActorRenderContext_t>(FindSignature("48 89 5C 24 ?? 48 89 74 24 ?? 48 89 4C 24 08 57 48 83 EC ?? ?? ?? ?? 48 8B F9 48 8D 05 ?? ?? ?? ?? 48 89 ?? 33 F6 48 89 71 08"));
BaseActorRenderContext_constructor(this, ScreenCtx, client, game);
}
void C_ItemRenderer::renderGuiItemNew(C_BaseActorRenderContext *BaseActorRenderCtx, C_ItemStack *item, MinecraftGame *game, float x, float y, float opacity, float scale, bool isEnchanted) {
using renderGuiItemNew_t = void(__fastcall *)(C_ItemRenderer *, C_BaseActorRenderContext *, C_ItemStack *, MinecraftGame *, float, float, float, float, float, bool);
static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast<renderGuiItemNew_t>(FindSignature("40 53 55 57 41 55 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 84 24 ? ? ? ? 49 8B 40 ? 49 8B D8 48 8B EA 4C 8B E9 48 85 C0"));
static renderGuiItemNew_t renderGuiItemNew = reinterpret_cast<renderGuiItemNew_t>(FindSignature("48 8B C4 48 89 58 20 55 56 57 41 54 41 55 41 56 41 57 48 81 EC 00 01 00 00 0F 29 70 B8 ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ??"));
item->setShowPickUp(false);
renderGuiItemNew(this, BaseActorRenderCtx, item, game, x, y, 1, opacity, scale, isEnchanted);
}
Expand Down Expand Up @@ -47,7 +47,7 @@ void C_ItemStack::fromTag(const Tag &tag) {
}
void C_ItemStack::save(CompoundTag **tag) {
using ItemStackBase__saveF = void(__fastcall *)(C_ItemStack *, CompoundTag **);
ItemStackBase__saveF save = reinterpret_cast<ItemStackBase__saveF>(FindSignature("48 89 5C 24 ?? 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC 90 ?? ?? ?? 48 8B F2 48 8B F9 48 89 55 17 4C 8B 79"));
ItemStackBase__saveF save = reinterpret_cast<ItemStackBase__saveF>(FindSignature("48 89 5C 24 ?? 55 56 57 41 56 41 57 48 8D 6C 24 C9 48 81 EC ?? ?? ?? ?? 48 8B FA 48 8B F1 48 89 55 0F 45 33 ?? 44 89 7D 97 33 C0"));
return save(this, tag);
}
void C_ItemStack::setUserData(std::unique_ptr<Tag> tag) {
Expand Down
4 changes: 2 additions & 2 deletions SDK/CItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MinecraftGame;

class C_BaseActorRenderContext {
private:
char pad_0x0[0x58]; //0x0000
char pad_0x0[0x60]; //0x0000
public:
C_ItemRenderer* renderer; //0x0058
private:
Expand Down Expand Up @@ -359,7 +359,7 @@ class C_ItemStack {

class C_ArmorItem : public C_Item {
private:
char pad_0x108[0xB8]; //0x100
char pad_0x108[0x228 - sizeof(C_Item)]; //0x100
public:
int ArmorSlot; //0x1B8

Expand Down

4 comments on commit 4551019

@Intoprelised
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTF

@Intoprelised
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHESTSTEALER?!??!??!

@dexteratyt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hot

@dexteratyt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHESTSTEALER?!??!??!

yea cuz he in tudou gang

Please sign in to comment.