-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix two pitch cracking and add three pitch cracking #1
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.
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; |
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.
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?
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.
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) { |
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.
did you test that this works?
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.
Yes, it also makes much more sense with the comparisons the loop is doing
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.
ok
No description provided.