Olafski / FastLeafDecay

Minecraft mod that provides faster leaf decay.
20 stars 7 forks source link

Recursive worldgen bug #8

Closed mezz closed 7 years ago

mezz commented 7 years ago

In Forge 1.11.2 - 13.20.0.2258 there is a new detection and log for worldgen features that load new chunks and cause more worldgen.

[FML]: Fast Leaf Decay loaded a new chunk (-414, -71 Dimension: 0) during chunk population, causing cascading worldgen lag. Please report this to the mod's issue tracker. This log can be disabled in the Forge config.

This seems to be happening in your handler for BlockEvent.NeighborNotifyEvent when trees are generated close to the edge of a chunk. Leaves are placed, and the handler tries to get the block state of neighbors, which causes a new chunk to load.

You can debug this by grabbing the latest Forge, creating a new world or flying around, and putting a breakpoint at this log (at the bottom of Chunk.java).

Here's the stack trace dump from a breakpoint at the log:

[14:58:31] [Server thread/INFO]: [STDERR]: java.lang.Exception: Stack trace
[14:58:31] [Server thread/INFO]: [STDERR]:  at java.lang.Thread.dumpStack(Thread.java:1333)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.chunk.Chunk.logCascadingWorldGeneration(Chunk.java:1526)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:989)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:982)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:158)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.getChunkFromChunkCoords(World.java:303)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.getChunkFromBlockCoords(World.java:298)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.getBlockState(World.java:903)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.olafkeijsers.fastleafdecay.LeafUpdateEventHandler.UpdateNeighbour(LeafUpdateEventHandler.java:29)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_110_LeafUpdateEventHandler_UpdateNeighbour_NeighborNotifyEvent.invoke(.dynamic)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(ForgeEventFactory.java:165)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.notifyNeighborsOfStateChange(World.java:481)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.notifyNeighborsRespectDebug(World.java:432)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.markAndNotifyBlock(World.java:373)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.setBlockState(World.java:353)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.World.setBlockState(World.java:417)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.genetics.TreeDefinition.setLogBlock(TreeDefinition.java:994)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.genetics.Tree.setLogBlock(Tree.java:194)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.worldgen.TreeBlockTypeLog.setBlock(TreeBlockTypeLog.java:33)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.core.worldgen.WorldGenHelper.addBlock(WorldGenHelper.java:30)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.core.worldgen.WorldGenHelper.generateTreeTrunk(WorldGenHelper.java:161)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.worldgen.WorldGenSilverLime.generateTrunk(WorldGenSilverLime.java:30)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.worldgen.WorldGenArboriculture.generate(WorldGenArboriculture.java:61)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.commands.TreeGenHelper.generateTree(TreeGenHelper.java:64)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.worldgen.TreeDecorator.decorateTrees(TreeDecorator.java:77)
[14:58:31] [Server thread/INFO]: [STDERR]:  at forestry.arboriculture.worldgen.TreeDecorator.decorateTrees(TreeDecorator.java:51)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_95_TreeDecorator_decorateTrees_Decorate.invoke(.dynamic)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraftforge.event.terraingen.TerrainGen.decorate(TerrainGen.java:61)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.biome.BiomeForest.addMushrooms(BiomeForest.java:118)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.biome.BiomeForest.decorate(BiomeForest.java:85)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.gen.ChunkProviderOverworld.populate(ChunkProviderOverworld.java:464)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1001)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:982)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:158)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.server.management.PlayerChunkMapEntry.providePlayerChunk(PlayerChunkMapEntry.java:126)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.server.management.PlayerChunkMap.tick(PlayerChunkMap.java:170)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.world.WorldServer.tick(WorldServer.java:221)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:709)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:149)
[14:58:31] [Server thread/INFO]: [STDERR]:  at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
[14:58:31] [Server thread/INFO]: [STDERR]:  at java.lang.Thread.run(Thread.java:745)
mezz commented 7 years ago

Never mind, this happens even without FastLeafDecay. Right after the event, the same thing happens, so this is caused by Forestry.

Ricket commented 7 years ago

@mezz Did you report a Forestry bug for this? I don't see it in the ForestryMC github issues.