Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTJS: Load modules earlier, allowing for initial gameLoad to trigger #102

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

camnwalter
Copy link
Member

@camnwalter camnwalter commented Jan 5, 2024

This reverts parts of 64525a3 and f19bec1. Keybinds aren't an issue anymore as the mixin runs after MinecraftClient::options is set.

Now gameLoad and top level in the module don't matter much, but the top level runs right before the gameload triggers.

println("above");

register("gameLoad", () => {
    println("game loaded");
});

println("below");

always outputs

above
below
game loaded

even on subsequent /ct loads

@mattco98
Copy link
Member

mattco98 commented Jan 7, 2024

Going forward, we should discourage the use of this trigger. I don't want to remove it because it looks like it's very commonly used (>500 uses), and it's one line anyways.

@mattco98 mattco98 merged commit 79e7b14 into ChatTriggers:main Jan 7, 2024
1 check passed
@camnwalter camnwalter deleted the load-modules branch January 7, 2024 18:53
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