Formations (Structure Library)

Formations (Structure Library)

10M Downloads

[Bug] Some chunk won't load

Zano1999 opened this issue Β· 9 comments

commented

Version Info

  • Minecraft 1.20.1
  • Formations 1.0.0

Version: Fabric Loader 0.14.23

Description of the Bug

Some chunks won't load but i can see the hitmarker of the block.
If that happens the session cant be saved and a teleport to another area result in an infinite fall into the void.

My mod list: https://pastebin.com/R0YpZrG1

Screenshots

image

commented

Are you sure this is caused by Formations? I have done quite a lot of flying around worlds and have never had any issues like this. And you also seem to be using quite a lot worldgen mods.

commented

Yes, I removed the mods in groups of 3 until I got to yours, the bug is very strange and specific, in fact it seems to happen in a specific chunk, create a world with this seed in 1.20.1: based

After that go to the following coordinates in the ocean: X:244 Y:73 Z:-3869

Ps: The guilty mod is not one that generates structures but the lib

commented

Thank you for looking into it and the steps to recreate the issue πŸ™‚

I installed both Formations (the library) and Formations Overworld, then created a world with seed based and flew to X:244 Y:73 Z:-3869. The world seems to load fine
image

The guilty mod is not one that generates structures but the lib

Hmm the lib on its own doesn't do anything. It depends on a datapack (Formations Overworld) using one of the structure types created by the lib.

commented

Seems like an incompatibility issue with another mod

commented

Seems I facing this. JStack shows it's the reason. Before continue, I waited for half hours to confirm it's a freeze
Server thread is waiting for async task

"Server thread" #560 prio=4 os_prio=-1 cpu=4375.00ms elapsed=1710.59s tid=0x00000232905c0930 nid=0x32b4 runnable  [0x000000d81a4fe000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
        - parking to wait for  <0x00000006241e0708> (a java.lang.String)
        at java.util.concurrent.locks.LockSupport.parkNanos([email protected]/LockSupport.java:252)
        at net.minecraft.class_1255.method_20813(class_1255.java:151)
        at net.minecraft.class_1255.method_18857(class_1255.java:141)
        at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:743)
        at net.minecraft.server.MinecraftServer.method_3774(MinecraftServer.java:488)
        at net.minecraft.server.MinecraftServer.method_3735(MinecraftServer.java:327)
        at net.minecraft.class_1132.method_3823(class_1132.java:69)
        at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:646)
        at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265)
        at net.minecraft.server.MinecraftServer$$Lambda$22464/0x00000232ffa7bfb8.run(Unknown Source)
        at java.lang.Thread.run([email protected]/Thread.java:833)

And I assume it is waiting for this thread since there isn't any other thread running logic and taked so much cpu time for generating unknown structures. There isn't any info in log

"Worker-Main-14" #242 daemon prio=4 os_prio=-1 cpu=1642875.00ms elapsed=1971.34s tid=0x00000232ba3d6410 nid=0x1764 runnable  [0x000000d81a0fd000]
   java.lang.Thread.State: RUNNABLE
        at java.util.ImmutableCollections$MapN.probe([email protected]/ImmutableCollections.java:1327)
        - parking to wait for  <0x00000006100f85f8> (a java.util.concurrent.ForkJoinPool)
        at java.util.ImmutableCollections$MapN.<init>([email protected]/ImmutableCollections.java:1187)
        at java.util.Map.ofEntries([email protected]/Map.java:1668)
        at java.util.stream.Collectors.lambda$toUnmodifiableMap$66([email protected]/Collectors.java:1516)
        at java.util.stream.Collectors$$Lambda$9145/0x00000232fdbfde00.apply([email protected]/Unknown Source)
        at java.util.function.Function.lambda$andThen$1([email protected]/Function.java:88)
        at java.util.function.Function$$Lambda$532/0x00000232fd46fa08.apply([email protected]/Unknown Source)
        at java.util.stream.ReferencePipeline.collect([email protected]/ReferencePipeline.java:686)
        at net.minecraft.class_3499.localvar$gin000$formations$processBlockInfos(class_3499.java:5816)
        at net.minecraft.class_3499.method_16446(class_3499.java)
        at net.minecraft.class_3499.method_15172(class_3499.java:225)
        at net.minecraft.class_3781.method_16626(class_3781.java:124)
        at net.minecraft.class_3790.method_27236(class_3790.java:89)
        at net.minecraft.class_3790.method_14931(class_3790.java:85)
        at net.minecraft.class_3449.method_14974(class_3449.java:100)
        at net.minecraft.class_2794.method_38265(class_2794.java:320)
        at net.minecraft.class_2794$$Lambda$27868/0x00000233001e5258.accept(Unknown Source)
        at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
        at net.minecraft.class_2794.method_12102(class_2794.java:319)
        at net.minecraft.class_2806.method_51375(class_2806.java:108)
        at net.minecraft.class_2806$$Lambda$1879/0x00000232fda25278.doWork(Unknown Source)
        at net.minecraft.class_2806$class_3768.doWork(class_2806.java:309)
        at net.minecraft.class_2806.method_12154(class_2806.java:252)
        at net.minecraft.class_3898.method_17225(class_3898.java:684)
        at net.minecraft.class_3898$$Lambda$22939/0x00000232ffb5ead8.apply(Unknown Source)
        at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
        at net.minecraft.class_3898.method_17224(class_3898.java:673)
        at net.minecraft.class_3898$$Lambda$22783/0x00000232ffb22a48.apply(Unknown Source)
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire([email protected]/CompletableFuture.java:1150)
        at java.util.concurrent.CompletableFuture$Completion.run([email protected]/CompletableFuture.java:482)
        at net.minecraft.class_3900.method_17634(class_3900.java:62)
        at net.minecraft.class_3900$$Lambda$22937/0x00000232ffb5e688.run(Unknown Source)
        at net.minecraft.class_3846.method_16907(class_3846.java:91)
        at net.minecraft.class_3846.method_16900(class_3846.java:146)
        at net.minecraft.class_3846.run(class_3846.java:102)
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec([email protected]/ForkJoinTask.java:1395)
        at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:373)
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1182)
        at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1655)
        at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1622)
        at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:165)

EDIT:
For further info. I enable the debug log. And modernfix may providing some info I'm not sure.
It's stucking at here. But not sure. Maybe a debug log from your mod is more valuable

[18:02:29] [Render thread/INFO] (net.minecraft.class_3951) ε‡†ε€‡η”ŸζˆεŒΊεŸŸδΈ­οΌš68%
[18:02:30] [Render thread/INFO] (net.minecraft.class_3951) ε‡†ε€‡η”ŸζˆεŒΊεŸŸδΈ­οΌš69%
[18:02:30] [Worker-Main-8/DEBUG] (ModernFix) Using cached upgraded version of biomemakeover:ghosttown/roads/street_03
[18:02:30] [Render thread/INFO] (net.minecraft.class_3951) ε‡†ε€‡η”ŸζˆεŒΊεŸŸδΈ­οΌš73%
commented

Could you test it with this jar: https://file.io/K3FsrfPb7j9u
It will print what Formations' structure is being placed and as well as some other info. I'm curious what it says when the server gets stuck.

commented

It's rare. Can't reproduce for now. MF, I've losed the save

commented

Got some help on Discord and it turns out Formations was looping over all blocks and copying their nbt for every structure instead of just the ones from the Formations' mods that need it. When combined with mods which add larger structures, that can cause quite a lot of lag.
I would presume this is the issue you two were also running into.

I fixed it now in Formations version 1.0.1. I will close the issue for now as this update should significantly change the performance for placing structures. If you run into the issue again, feel free to open a new issue for it.

Anyways, thank you both for reporting it and helping investigate πŸ™‚

commented

Can you link it for context?