Enhanced AI

Enhanced AI

7M Downloads

Nether dimension freezing.

BiakCeu opened this issue ยท 6 comments

commented

I've done some testing with and without EnhancedAI and another version. And through my testing, I've found out that the Nether dimension freezes whenever a wither skeleton spawns in. I don't know why and I'm really sad as this mod is a stable to my modpack. I don't know if it's a conflict with another mod but it really is a shame and I'm hoping it's something that's fixable. I will attach the log.

Versions where you encountered the problem (Use the exact version numbers, not 'latest' or similar):

  • Minecraft:
  • Forge: 1.20.1 47.1.3
  • Enhanced AI: 1.15.1 and 1.15.0
  • InsaneLib: 1.10.2

Steps to reproduce

  1. Have the said mods.
  2. Make a new world and go to the nether
  3. Find a nether fortress and when a wither skeleton spawns, the world freezes. The freeze may happen before the fortress fully even loads in.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
Use a paste site (pastebin, gist) to send the game logs (both logs and crash if applicable)
For the love of god, don't paste the logs here

Can the issue be reproduced with EnhancedAI only (or with a minimal set of mods)?
I have high amount of mods and have not tested with just the two so I'm not sure.

commented

I can't do much with all these mods, reproduce with EnhancedAI and any other mod that might be causing this.

commented

I disabled the wither skeleton spawn with bows and so far it seemed to fix it.

commented

No more infos given, closing

commented

The conflict appears to be with Yung's Better Nether Fortresses.

Versions

  • Forge 1.20.1 47.2.0
  • EnhancedAI 1.15.3
  • InsaneLib 1.11.1
  • YungsApi 4.0.2
  • YungsBetterNetherFortresses 2.0.5

Logs/Crashes

  • Nothing useful in logs
  • Client hangs when holding F3+C

Proflier data

Similar call stack in the Server Thread than what ModernFix dumped in the OP's log. This profile was taken after the freeze, all threads included:

Server Thread
Server thread
 java.lang.Thread.run ()
  net.minecraft.server.MinecraftServer$$Lambda$8694.0x00000008011f4938.run ()
   net.minecraft.server.MinecraftServer.m_206580_ ()
    net.minecraft.server.MinecraftServer.m_130011_ ()
     net.minecraft.server.MinecraftServer.m_130012_ ()
      net.minecraft.util.thread.BlockableEventLoop.m_18701_ ()
       net.minecraft.server.MinecraftServer.m_7245_ ()
        net.minecraft.server.MinecraftServer.m_129961_ ()
         net.minecraft.server.level.ServerChunkCache.m_8466_ ()
          net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.m_7245_ ()
           net.minecraft.util.thread.BlockableEventLoop.m_7245_ ()
            net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.m_6367_ ()
             net.minecraft.util.thread.BlockableEventLoop.m_6367_ ()
              net.minecraft.server.level.ChunkTaskPriorityQueueSorter$$Lambda$8942.0x0000000801266148.run ()
               net.minecraft.server.level.ChunkTaskPriorityQueueSorter.m_143188_ ()
                java.util.concurrent.CompletableFuture$Completion.run ()
                 java.util.concurrent.CompletableFuture$UniApply.tryFire ()
                  net.minecraft.server.level.ChunkMap$$Lambda$9104.0x0000000801299430.apply ()
                   net.minecraft.server.level.ChunkMap.m_287044_ ()
                    com.mojang.datafixers.util.Either.mapLeft ()
                     com.mojang.datafixers.util.Either$Left.map ()
                      com.mojang.datafixers.util.Either$$Lambda$8926.0x0000000801259c00.apply ()
                       com.mojang.datafixers.util.Either.lambda$mapLeft$0 ()
                        net.minecraft.server.level.ChunkMap$$Lambda$9107.0x0000000801299ab0.apply ()
                         net.minecraft.server.level.ChunkMap.m_214854_ ()
                          net.minecraft.world.level.chunk.LevelChunk.m_62952_ ()
                           net.minecraft.server.level.ChunkMap$$Lambda$9108.0x000000080129a9f0.m_196866_ ()
                            net.minecraft.server.level.ChunkMap.m_214898_ ()
                             net.minecraft.server.level.ChunkMap.m_143064_ ()
                              net.minecraft.server.level.ServerLevel.m_143327_ ()
                               net.minecraft.world.level.entity.PersistentEntitySectionManager.m_157559_ ()
                                java.util.stream.ReferencePipeline$Head.forEach ()
                                 java.util.Spliterator.forEachRemaining ()
                                  net.minecraft.world.entity.EntityType$1.tryAdvance ()
                                   java.util.ArrayList$ArrayListSpliterator.tryAdvance ()
                                    net.minecraft.world.entity.EntityType$1$$Lambda$9227.0x00000008012c74b0.accept ()
                                     net.minecraft.world.entity.EntityType$1.m_147056_ ()
                                      net.minecraft.world.entity.EntityType.m_20645_ ()
                                       java.util.Optional.map ()
                                        net.minecraft.world.entity.EntityType$1$$Lambda$9228.0x00000008012c76e0.apply ()
                                         net.minecraft.world.entity.EntityType$1.m_147060_ ()
                                          net.minecraft.world.level.entity.PersistentEntitySectionManager$$Lambda$9226.0x00000008012c7280.accept ()
                                           net.minecraft.world.level.entity.PersistentEntitySectionManager.m_157604_ ()
                                            net.minecraft.world.level.entity.PersistentEntitySectionManager.m_157538_ ()
                                             net.minecraftforge.eventbus.EventBus.post ()
                                              net.minecraftforge.eventbus.EventBus.post ()
                                               net.minecraftforge.eventbus.EventBus$$Lambda$4763.0x0000000800d4ce68.invoke ()
                                                net.minecraftforge.eventbus.ASMEventHandler.invoke ()
                                                 insane96mcp.enhancedai.modules.skeleton.feature.__WitherSkeletons_onSpawn_EntityJoinLevelEvent.invoke ()
                                                  insane96mcp.enhancedai.modules.skeleton.feature.WitherSkeletons.onSpawn ()
                                                   net.minecraft.world.level.Level.m_6436_ ()
                                                    net.minecraft.world.level.Level.m_46745_ ()
                                                     net.minecraft.world.level.Level.m_6325_ ()
                                                      net.minecraft.world.level.LevelReader.m_46819_ ()
                                                       net.minecraft.world.level.Level.m_6522_ ()
                                                        net.minecraft.server.level.ServerChunkCache.m_7587_ ()
                                                         net.minecraft.util.thread.BlockableEventLoop.m_18701_ ()
                                                          net.minecraft.util.thread.BlockableEventLoop.m_5667_ ()
                                                           java.util.concurrent.locks.LockSupport.parkNanos ()
                                                           java.lang.Thread.yield[native] ()

Steps to Reproduce

  1. Install EnhancedAI and Yung's Better Nether Fortresses
  2. Create a world with cheats turned on
  3. Create a Nether Portal and travel to The Nether
  4. Use the locate command to find a Better Nether Fortress
    /locate structure #betterfortresses:better_fortresses
  5. Travel to the location or TP there

Observations

  • Not observed with just EnhancedAI, confirmed that archer wither skeletons are spawning
  • The Server Thread appears to be waiting for a lock on some level data in the chunk cache
  • There are no tasks being run in worker threads

It looks like Yung's structure generation code has a lock on some level data which Enhanced AI tries to access and this deadlocks the thread.

This issue on Yung's GitHub may be related:

commented

Not sure it's related to YUNG's but found the culprit. Fixed in 1.15.4