Realistic Ore Veins

Realistic Ore Veins

356k Downloads

Memory Corruption Bug

Speiger opened this issue · 4 comments

commented

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.

commented

Heya,

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

commented

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)

commented
commented

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)