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

[Bugfix] Fix infinite loop in TranslationTask #721

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DerToaster98
Copy link
Contributor

Describe in detail what your pull request accomplishes

There is a infinite loop in TranslationTask.java in the validation for forbidden hover blocks. In short, the position moves out of worldspace and thus the returned block will always be air, resulting in a infinite loop.

Also fixed a probably missing return statement further down, if a block was found that can't be hovered over

Related issues:

  • dont know of one, but this bug is known on TTE and strangelands

Checklist

  • Unit tests
  • Proper internationalization
  • Tested

test = test.translate(0, -1, 0);
}
Material testType = test.toBukkit(world).getBlock().getType();
if (craft.getType().getMaterialSetProperty(CraftType.FORBIDDEN_HOVER_OVER_BLOCKS).contains(testType)) {
// Why is there no return here? Shouldnt there be one?
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a serious question i have there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, it seems i confused the lines when i wrote that comment, but anyway. Once the craft goes over a forbidden hover over block, it can't translate at all. Calling fail also pretty much implies that the result is final at that point, but yet the function would continue, so the return is necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants