-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Fix two bugs with block iterator #5566
Conversation
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 get a test to make sure the blocks being looped are actually the ones we expect?
…x/block-iterator
Sure, there isn't really much to test aside from the block iterator size. The other bug is an exception that's fixed. |
(cherry picked from commit 8dfa83d)
Description
First bug fix is the referenced issue that restricts a vector of zero when grabbing blocks with a single location and single direction.
Bukkit throws an IllegalArgumentException if Vector#isZero is true. So we have to disallow that here.
Second bug is the fact that when using direction with a number, the ExprBlocks expression would not respect the value. So for example
loop blocks 5 above the player
would loop blocks between the player and 100 blocks above because that was the max target block distance. It now properly loops 5 blocks. No clue how no one ever reported this. I guess i'm the only one that uses Skript's overly complex directional support.I also cleaned up ExprBlocks and BlockLineIterator
Target Minecraft Versions: any
Requirements: none
Related Issues: #5565