Magic Totems

Magic Totems

2.4k Downloads

Totems occasionally cause world hang when quitting

Jackiecrazy opened this issue ยท 1 comments

commented

This is not reliably reproducible, but totems will interfere with proper saving and quitting occasionally. At that point the only way to quit the game is to kill -9 it. I'm currently procuring a thread dump.

commented

got it.

java.lang.Thread.State: TIMED_WAITING (parking)
        at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
        - parking to wait for  <0x000000063c5ce910> (a java.lang.String)
        at java.util.concurrent.locks.LockSupport.parkNanos([email protected]/LockSupport.java:269)
        at net.minecraft.util.thread.BlockableEventLoop.m_5667_([email protected]/BlockableEventLoop.java:152)
        at net.minecraft.util.thread.BlockableEventLoop.m_18701_([email protected]/BlockableEventLoop.java:142)
        at net.minecraft.server.level.ServerChunkCache.getChunkBlocking([email protected]/ServerChunkCache.java:1262)
        at net.minecraft.server.level.ServerChunkCache.m_7587_([email protected]/ServerChunkCache.java:1158)
        at net.minecraft.world.level.Level.m_6522_([email protected]/Level.java:179)
        at net.minecraft.world.level.Level.m_46865_([email protected]/Level.java:2541)
        at net.minecraft.world.level.Level.m_46745_([email protected]/Level.java:2536)
        at net.minecraft.world.level.Level.m_7702_([email protected]/Level.java:507)
        at net.minecraft.world.level.BlockGetter.m_141902_([email protected]/BlockGetter.java:26)
        at net.minecraft.world.level.CommonLevelAccessor.m_141902_([email protected]/CommonLevelAccessor.java:19)
        at daripher.totems.block.entity.TotemTopBlockEntity.getEffect([email protected]/TotemTopBlockEntity.java:49)
        at daripher.totems.block.entity.TotemTopBlockEntity.m_183515_([email protected]/TotemTopBlockEntity.java:34)
        at net.minecraft.world.level.block.entity.BlockEntity.m_187482_([email protected]/BlockEntity.java:77)
        at net.minecraft.world.level.block.entity.BlockEntity.m_187480_([email protected]/BlockEntity.java:64)
        at net.minecraft.world.level.chunk.LevelChunk.m_8051_([email protected]/LevelChunk.java:368)
        at net.minecraft.world.level.chunk.storage.ChunkSerializer.m_63454_([email protected]/ChunkSerializer.java:342)
        at net.minecraft.server.level.ChunkMap.m_140258_([email protected]/ChunkMap.java:803)
        at net.minecraft.server.level.ChunkMap.m_202998_([email protected]/ChunkMap.java:497)
        at net.minecraft.server.level.ChunkMap$$Lambda$52007/0x0000000805792678.accept([email protected]/Unknown Source)
        at java.util.concurrent.CompletableFuture$UniAccept.tryFire([email protected]/CompletableFuture.java:718)
        at java.util.concurrent.CompletableFuture$Completion.run([email protected]/CompletableFuture.java:482)
        at net.minecraft.server.level.ChunkMap.m_140353_([email protected]/ChunkMap.java:470)
        at net.minecraft.server.level.ChunkMap.m_140280_([email protected]/ChunkMap.java:441)
        at net.minecraft.server.level.ServerChunkCache.m_201698_([email protected]/ServerChunkCache.java:314)
        at net.minecraft.server.MinecraftServer.m_7041_([email protected]/MinecraftServer.java:567)
        at net.minecraft.client.server.IntegratedServer.m_7041_([email protected]/IntegratedServer.java:173)
        at net.minecraft.server.MinecraftServer.m_130011_([email protected]/MinecraftServer.java:682)
        at net.minecraft.server.MinecraftServer.m_206580_([email protected]/MinecraftServer.java:244)
        at net.minecraft.server.MinecraftServer$$Lambda$46968/0x00000008051a8230.run([email protected]/Unknown Source)
        at java.lang.Thread.run([email protected]/Thread.java:1589)

My best guess is that the totem's bottom block check (and maybe top block check as well) should be wrapped in a check to see if the chunk is loaded.

As an aside, I notice that the totems will grant effects on both the client and the server, which, if the server one didn't stick for any reason, leads to a client one that wouldn't go away until reload.