ore-veins
ore-veins copied to clipboard
Memory Corruption Bug
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.
Heya,
Do you think replacing it with ThreadLocalRandom
is a good enough solution?
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)
Yeah I noticed that just now, haha (porting to 1.16.5). No need for the field at all.
Get BlueMail for Android
On 5 Jun 2021, 22:54, at 22:54, Speiger @.***> wrote:
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)
-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/alcatrazEscapee/ore-veins/issues/68#issuecomment-855236458
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)