Skip to content

ExprAttachedBlock Plural Support #7897

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 4 commits into
base: dev/feature
Choose a base branch
from

Conversation

erenkarakal
Copy link
Member

@erenkarakal erenkarakal commented May 24, 2025

Problem

Paper deprecated the old method for being unreliable, as arrows can be attached to multiple blocks at once. The old method used to be completely broken for full blocks, but it looks like it was fixed before it was deprecated, so no errors/warnings are thrown if you use the old version.

Solution

  • Rewrites ExprAttachedBlock to be a PropertyExpression
  • Adds an optional pattern for returning a list of blocks

Testing Completed

Reflection check, null values and new patterns were tested.

Supporting Information

No breaking changes


Completes: #7753
Related: Paper#12096, Paper#12099

@erenkarakal erenkarakal requested a review from a team as a code owner May 24, 2025 12:23
@erenkarakal erenkarakal requested review from Efnilite and cheeezburga and removed request for a team May 24, 2025 12:23
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label May 24, 2025
@erenkarakal erenkarakal added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label May 24, 2025
@erenkarakal erenkarakal requested a review from UnderscoreTud May 27, 2025 09:03

@Override
protected Block[] get(Event event, Projectile[] source) {
List<Block> blocks = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

Thoughts on making this a Set to remove duplicate blocks?
I could see it both ways

}

}
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
}
}

@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label May 28, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants