Skip to content

Update use functions #130

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

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from
Open

Update use functions #130

wants to merge 2 commits into from

Conversation

LShiftLess
Copy link

It makes the code in the toRun and toProfile block more clear and logical.

@LShiftLess LShiftLess closed this Jul 13, 2025
@thedarkcolour
Copy link
Owner

I know you closed this PR, but here are my two cents:

In its current state, it introduces breaking changes to these library functions. This means you'd either have to wait for KFF 6.x, or you'd have to create new functions with different names.

@LShiftLess LShiftLess reopened this Jul 13, 2025
@LShiftLess
Copy link
Author

LShiftLess commented Jul 13, 2025

There is a new commit make the block Consumer-like.
The raw one is a breaking change, but new one is not.

The kotlin can make a lambda ellipsis its param, means the old code should still work fine.

For example,

poseStack.use {
    poseStack.scale(3.0f, 0.1f, 3.0f)
}

The code after changes can be like this,

poseStack.use { poseStack ->
    poseStack.scale(3.0f, 0.1f, 3.0f)
}

or

poseStack.use { 
    it.scale(3.0f, 0.1f, 3.0f)
}

But at the same time, the original one still works, too.

If you still have doubts, I am not opposed to bring changes to 6.x version.
But in my opinion, this update won't bring any error or crash.

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