Skip to content

Add hook for modloader#117

Merged
void2012 merged 1 commit intosmartcmd:mainfrom
DanielLMcGuire:main
Mar 2, 2026
Merged

Add hook for modloader#117
void2012 merged 1 commit intosmartcmd:mainfrom
DanielLMcGuire:main

Conversation

@DanielLMcGuire
Copy link
Contributor

Description

This adds a simple hook for modloading systems, including my own

Changes

Added hook for potential modloaders

extern "C" __declspec(dllexport) Minecraft* GetGameInstance();

See https://github.com/DanielLMcGuire/LCE-SDK

@void2012
Copy link
Collaborator

void2012 commented Mar 2, 2026

Is this exact approach already broadly established in the modding community? Also, I would consider putting a calling convention and extern "C" here.

@void2012 void2012 marked this pull request as draft March 2, 2026 08:55
@DanielLMcGuire
Copy link
Contributor Author

DanielLMcGuire commented Mar 2, 2026

Usually we would do a ton of math and tests to find the pointer offset ourselves, but this makes my life less hell

Other than that yes

@void2012
Copy link
Collaborator

void2012 commented Mar 2, 2026

I understand, but we need a calling convention and extern "C" to avoid MSVC artifacts and make this compatible with other compilers

@DanielLMcGuire
Copy link
Contributor Author

I put one already

@void2012
Copy link
Collaborator

void2012 commented Mar 2, 2026

Ah, didn't see the extern "C" at the first look, sorry.
As for the calling convention, it appears that we target only x64 now, so we're fine because it's mostly x86 headache

@void2012 void2012 marked this pull request as ready for review March 2, 2026 09:12
@void2012 void2012 merged commit 7bee477 into smartcmd:main Mar 2, 2026
void2012 added a commit that referenced this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants