-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Create clamp expression #6567
Create clamp expression #6567
Conversation
I think I'd rather fix the function return behaviour than make a syntax for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skimmed over it and this is all I saw for now
there is no bug in function return behavior is works how it's intended to |
Co-authored-by: Fusezion <fusezionstream@gmail.com>
And I'm saying the behaviour is poor and could be done better. |
I don't much like this addition as Functions are better fit for this. |
Same could be said about the
It can't be done better when the function literally can't support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops missed some points
Maybe I didn't make it clear, I am recommending we fix the issue with variable arity returns not being permitted in single changers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we fix the function, I don't think that means we can't have an expression as well if people want both, but I think it has room for improvement.
Fix examples Check if getSingle is null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just incase this is still approved to be added which I see no reason not to speaking there's already a round expression too. There should be test added as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could have some tests for this? Tests make the world go round!
I was looking over the clamp function tests but got confused by these three.
Why are they getting compared to themselves? I feel like these should be checking if the output is set. |
If I remember correctly this was one of the ways to check for 'not a number' because it didn't test equal to itself. I don't know if that's still the case anymore and we may have a better way. |
yes we have isNaN() now! |
In that case should it become |
yes exactly |
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Do we still want to move ahead with this now that the function is fixed? I like having the |
Description
Creates a clamp expression to clamp values between a min and a max.
This is my first time working with skript so any help/tips would be appreciated :)
Target Minecraft Versions: any
Requirements: none
Related Issues: #6488