Tech Reborn

Tech Reborn

30M Downloads

Retrogen causes new chunk generation with constantly increasing coordinates up to ridiculous numbers.

IcedLance opened this issue ยท 2 comments

commented

So I believe retrogen is broken. What it doesn't do is retrogenerate ores in all nearby chunks, what it does do is generate ores in some select few reachable chunks and then starts generating new chunks with increasing coordinates until it gets ridiculous.

I've left it running for 5 minutes and I already have "r.-26488.82056.mca" region file generated. Game log is spammed with messages like:

[21:19:00] [Server thread/INFO]: Regenerating ore in ChunkCoord{X=-351, Z=561}.
[21:19:00] [Server thread/INFO]: Queueing retro ore gen for ChunkCoord{X=-5615, Z=8977}.
[21:19:00] [Server thread/INFO]: Queueing retro ore gen for ChunkCoord{X=-5615, Z=8976}.
[21:19:00] [Server thread/INFO]: Queueing retro ore gen for ChunkCoord{X=-5616, Z=8977}.
[21:19:01] [Server thread/INFO]: Regenerating ore in ChunkCoord{X=-352, Z=561}.

Note, that 8976 = 561*16. I guess 8977 got pulled by association.

I believe the issue is caused by this line in /src/main/java/techreborn/world/TechRebornRetroGen.java :

77: Core.worldGen.generate(rng, coord.getX() << 4, coord.getZ() << 4, world, null, null);

I guess it assumes, that coord.getX and coord.getZ return block coordinates of some kind, but (Nah, then it would be the other way around, but it's still wrong.) they actually return Chunk coordinates, that get multiplied by 16 and passed to worldGen, which causes onLoad to happen and queue that chunk*16 to get queued (and sometimes its neighbors) etc ad infinitum.

commented

I tried it and removing << 4 worked. Ores retrogenerate properly.

commented

Thanks for the suggested fix. Should be working as expected, I also fixed it not marking the chunk as generated if the tree gen is disabled. In 1.13 I plan to redo the world gen so it will be possible to retro gen specific features such as the trees.