gnembon / fabric-carpet

Fabric Carpet
MIT License
1.65k stars 261 forks source link

Extract all logic in `modifiedRunLoop` to small injections #1770

Closed altrisi closed 8 months ago

altrisi commented 11 months ago

Reviewing wanted! I'm not good at all with mixins, and although this has taken me a while and I've tried to check and the output is similar, it may not be the same! And this is quite a core part of Carpet (and vanilla!) that I'd prefer to not have messed up.

This PR gets rid of modifiedRunLoop and instead separates it into smaller mixins to the specific places where Carpet was changing its behaviour. This has the following benefits:

As a compromise, the local variable msThisTick is now global, but shouldn't be an issue given that should always accessed by the same thread and in the same section.

Missing (only ideally, likely not really needed for it to just work):

Resolves #1747.

altrisi commented 11 months ago

Currently crashes with g4mespeed.

altrisi commented 8 months ago

It got extracted further it seems!