forked from ChatTriggers/ctjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mixins: Do not crash when a mixin has no associated handler
Initially it made sense to crash, but after some experience this is not a viable solution. There is usually a bit of time between when the mixin is created and when `.attach()` is called. If the mixin attempts to run in between this period, it would lead to a crash, however this is not user error. To fix this, all generated mixins now check with `JSLoader` to see if they have an attached method before attempting to invoke it. If there is no attached method yet, the mixin will act as if it did not exist (e.g. do nothing for inject mixins, call the original method for redirect mixins, etc). With this change, CT users can now inject into places that are invoked early in the startup process, such as MinecraftClient.setScreen (which is invoked in the MinecraftClient constructor).
- Loading branch information
Showing
19 changed files
with
419 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.