Skip to content

Conversation

@sovdeeth
Copy link
Member

@sovdeeth sovdeeth commented Apr 5, 2025

Description

The current method of checking if the current execution has been delayed utilises Delay.isDelayed(Event), which returns whether a delay has been run in that event before. If the event only corresponds to a single trigger, this is ok. However, as soon as 2 triggers enter the picture, problems arise:

on jump:
  send isDelayed # sends false
  wait 1 tick # adds to DELAYED
  send isDelayed # sends true

on jump:
  send isDelayed # uh oh, this ran after the first event, so the event's already in DELAYED! returns TRUE
  wait 1 tick
  send isDelayed # sends true

This PR attempts to resolve that by moving this logic to Trigger, so each trigger tracks whether it has been delayed for an Event or not. The old methods are deprecated and marked for removal, but are still functional.

Current issues/concerns:

  • Grabbing a Trigger from an Expression context
  • Is getTrigger reliable when working with sections that completely overwrite context, like EffSecSpawn?

Some simple cleanup was done to classes affected by the deprecation. Anything more is out of scope.


Target Minecraft Versions: any
Requirements: none
Related Issues: #7393 (not a fix)

Worries about sections that start completely new events, and worries about getting trigger from Expresssions
@sovdeeth sovdeeth added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. enhancement Feature request, an issue about something that could be improved, or a PR improving something. labels Apr 5, 2025
Efnilite
Efnilite previously approved these changes Apr 5, 2025
@sovdeeth sovdeeth dismissed Efnilite’s stale review April 7, 2025 00:00

This is not in a state for approval; it does not even build.

@sovdeeth
Copy link
Member Author

I cannot think of a way to figure out the current triggeritem from an Expression, or to even reliably find it and store it at parse time, so this is on hold until a better runtime context (with execution stack!) is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. enhancement Feature request, an issue about something that could be improved, or a PR improving something. help wanted Contributions are highly welcomed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants