Skip to content
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

Wait Until #7288

Open
wants to merge 1 commit into
base: dev/feature
Choose a base branch
from

Conversation

TheAbsolutionism
Copy link
Contributor

Description

This PR aims to allow using EffDelay to wait until condition is met.

Test Proof
https://github.com/user-attachments/assets/1d5f6d62-6690-4f47-9a4e-a3774a39564a


Target Minecraft Versions: any
Requirements: none
Related Issues: #5768

@sovdeeth
Copy link
Member

sovdeeth commented Dec 20, 2024

I'm not sure I like hiding the mechanics from the user in this case. It doesn't seem like a significant improvement over

while x is not y:
    wait

(it also seems ripe for causing a lot of hidden background while loops that will spin forever)

@sovdeeth sovdeeth added enhancement Feature request, an issue about something that could be improved, or a PR improving something. up for debate When the decision is yet to be debated on the issue in question labels Dec 20, 2024
@TheAbsolutionism
Copy link
Contributor Author

(it also seems ripe for causing a lot of hidden background while loops that will spin forever)

Even with SecWhile you get infinite loops if not handled correctly

idea64_f6cdRAxzPA.mp4

@sovdeeth
Copy link
Member

sovdeeth commented Dec 20, 2024

(it also seems ripe for causing a lot of hidden background while loops that will spin forever)

Even with SecWhile you get infinite loops if not handled correctly

Of course, but it's very clear that it's a while loop. It's not disguised.
I think it may be better to delay something like this until a proper task execution system is in place (2.11 plans), just so we aren't adding to the problem in the meantime.

@Pikachu920
Copy link
Member

I'm not sure I like hiding the mechanics from the user in this case. It doesn't seem like a significant improvement over

while x is not y:
    wait

(it also seems ripe for causing a lot of hidden background while loops that will spin forever)

+1

Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of me likes this, though I do share some of the concerns presented by sovde. Additionally, in its current state, this leads to repeat expression evaluation (ex: for the timespan) which is not ideal. We'd probably want to make this more efficient by avoiding that and using a repeated task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. up for debate When the decision is yet to be debated on the issue in question
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants