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

Memory Corruption Bug #68

Open
Speiger opened this issue Mar 23, 2021 · 4 comments
Open

Memory Corruption Bug #68

Speiger opened this issue Mar 23, 2021 · 4 comments

Comments

@Speiger
Copy link

Speiger commented Mar 23, 2021

https://github.com/alcatrazEscapee/ore-veins/blob/1.15.x/src/main/java/com/alcatrazescapee/oreveins/world/VeinsFeature.java#L35

This random needs not to stay inside of the class have a unique random per function call.
Because the code is actually executed in a "Multithreaded" manner. Multiple Chunks could call this function at the exact same time, meaning if they do that you corrupt your random and get really really really really bad results.

@cosmicdan
Copy link

Heya,

Do you think replacing it with ThreadLocalRandom is a good enough solution?

@Speiger
Copy link
Author

Speiger commented Jun 5, 2021

Hey,

Just use the random provided by the worldgenerator. You can even reset it yourself if you want to. But its already initialized with the seed.
https://github.com/alcatrazEscapee/ore-veins/blob/1.15.x/src/main/java/com/alcatrazescapee/oreveins/world/VeinsFeature.java#L77
(Random Argument)

@cosmicdan
Copy link

cosmicdan commented Jun 5, 2021 via email

@Speiger
Copy link
Author

Speiger commented Jun 6, 2021

Especially since i found a way to multithread worldgeneration truely and this mod would BREAK instantly
(You should fix this for 1.14.4 too)

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

No branches or pull requests

2 participants