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

Fix two pitch cracking and add three pitch cracking #1

Merged

Conversation

Gaider10
Copy link

No description provided.

Copy link
Owner

@RealRTTV RealRTTV left a comment

Choose a reason for hiding this comment

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

is there any other random calls events with the villager we can adjust to?

private float firstPitch = Float.NaN;
private int ticksBetweenSounds = 0;
private float secondPitch = Float.NaN;
@Nullable
private long[] seedsFromTwoPitches = null;
Copy link
Owner

@RealRTTV RealRTTV Jun 20, 2024

Choose a reason for hiding this comment

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

can we rename this to filteredSeeds / remainingSeeds and make it so that the third pitch check is instead the nth pitch check that filters down the long[] and sets the random if there's precisely one seed left?

Copy link
Author

Choose a reason for hiding this comment

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

I don't really see the point of making it work for more than 3 calls, most likely there's never going to be a seed where more than 3 pitches are needed since they already give much more than 48 bits of info

@@ -333,7 +413,7 @@ public long[] crackSeed() {
}
rand.nextInt(100);
}
if (rand.nextInt(1000) >= ticksBetweenSounds) {
if (rand.nextInt(1000) >= ticksBetweenSounds - 80 - 1) {
Copy link
Owner

Choose a reason for hiding this comment

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

did you test that this works?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it also makes much more sense with the comparisons the loop is doing

Copy link
Owner

Choose a reason for hiding this comment

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

ok

@RealRTTV RealRTTV merged commit bff08d1 into RealRTTV:villager_rng_cracking Jun 20, 2024
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.

2 participants