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

Update VillagerUtil.java #45

Merged
merged 4 commits into from
Oct 14, 2022
Merged

Update VillagerUtil.java #45

merged 4 commits into from
Oct 14, 2022

Conversation

BrekiTomasson
Copy link
Contributor

Fixes crash when generating names as the random number generated can otherwise be out of bounds.

Fixes crash when generating names as the random number generated can otherwise be out of bounds.
@OverlordsIII
Copy link
Owner

Thanks for PR-ing!

@OverlordsIII OverlordsIII merged commit 8bd84d2 into OverlordsIII:master Oct 14, 2022
@BrekiTomasson BrekiTomasson deleted the patch-1 branch October 14, 2022 05:55
@BrekiTomasson
Copy link
Contributor Author

You think you can build & release the fix for the v1.18 version as well?

@Fourmisain
Copy link

Breki, I'm fairly certain you were lamenting a "bound must be positive" error, not an out of bounds error.
nextInt already excludes the bound so out of bounds is impossible here (and this change will drop one of the names).

The "bound must be positive" error is instead caused when the bound is <= 0.
Why that happens, I'm not yet sure, maybe the mod loaded an empty names list or there's some config init issue or something like that? Haven't looking into it yet.

Either way, this change should be reverted.

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