Extract all logic in modifiedRunLoop
to small injections
#1770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:TimeProfiler
being private that meant we had to copy all the logic that used it with our own typeAs 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):
l = Util.getMillis() - this.nextTickTime;
with ourl
in thepreTick
(currently lost)Resolves #1747.