Lootr icon indicating copy to clipboard operation
Lootr copied to clipboard

World Freezes And Stops Loading Chunks

Open LThreeZeroT opened this issue 10 months ago • 9 comments

I was walking around in a modded world, and i got the error "Tried to load a DUMMY block entity @ class_2338{x=181, y=-36, z=783} but found not block entity block Block{minecraft:air} at location". I recreated the world and teleported myself to the coordinates mentioned in the error, and it was a regular double chest, but then it turned into 2 small lootr chests. I have a feeling this is what caused the error.

LThreeZeroT avatar Apr 06 '24 23:04 LThreeZeroT

What mod loader and version of Minecraft were you using?

Did you pre-generate the world at all?

noobanidus avatar Apr 07 '24 01:04 noobanidus

I was using Fabric 1.20.1

The world that crashed was not pre generated at all

LThreeZeroT avatar Apr 09 '24 02:04 LThreeZeroT

Are you able to upload your latest.log or debug.log files and any relevant crash reports?

noobanidus avatar Apr 09 '24 03:04 noobanidus

I will when i get the chance.

LThreeZeroT avatar Apr 09 '24 20:04 LThreeZeroT

I was only able to find the log as a notepad file

LThreeZeroT avatar Apr 14 '24 23:04 LThreeZeroT

Nevermind

LThreeZeroT avatar Apr 14 '24 23:04 LThreeZeroT

I found it

LThreeZeroT avatar Apr 14 '24 23:04 LThreeZeroT

https://mclo.gs/WMD2k8H

LThreeZeroT avatar Apr 14 '24 23:04 LThreeZeroT

All right, so I'm working through this now.

The DUMMY is a bit of a confusing situation, I'll try to explain exactly how it works -- even though I don't fully understand it myself.

When world generation is taking place, blocks are assigned to locations with the setBlock call in the WorldGenRegion. It'll fail if the chunk is unwriteable, otherwise the block will be set to that location.

If the block has an associated block entity (for example, chests, etc), it will attempt to create a block entity for it. However, this branches depending on the "type" of the chunk: if it is a LEVELCHUNK, then it will create the block entity and continue as normal.

If it is instead a PROTOCHUNK, Minecraft doesn't have enough information to actually create the block entity and, instead, creates a "dummy" entry.

Later in the process, a function called promotePendingBlockEntity is called specifically to handle these DUMMY block entities: they get the block state to ensure that it hasn't changed, and then create the block entity.

When this error message occurs, promotePendingBlockEntity has attempted to "promote" a DUMMY entry, but the actual block located in that position has no associated block entity. Hence, the error message you received is printed out.

Specifically, as the error message says "air", the implication is that, at some point during world generation:

  • setBlock was called with a block that has a block entity.
  • the chunk status was not LEVELCHUNK, so a dummy block entity was created.
  • separately, setBlock was called again, changing block to a different block (air, in this case)
  • as air doesn't have a block entity, the dummy entity is not removed.

It seems as though some structure or feature that initially called setBlock that included a block entity (like a chest) failed for some reason and was potentially "removed", or some other world generation took place that caused the blocks of that structure to be overwritten with other blocks or otherwise removed.

Unfortunately, all of this takes place before Lootr gets involved.

If the chunk status is LEVELCHUNK, then the block entity is directly created and Lootr is informed and adds this block to its queue.

If the chunk status is not LEVELCHUNK, then the dummy entry is created. Later, when the dummy entry is promoted, the block entity is finally created and Lootr is informed.

As this is taking place before Lootr, it's not specifically an issue with Lootr but rather with the world generation of some of the other mods that you have installed; which one specifically, I'm not able to say.

That re-creating the world in single-player and teleporting directly to the location causes the structure to generate correctly seems to indicate that some race condition is at play that is causing structure generation to fail, but I'm not sure what it could be, so I'm not sure how to diagnose the issue for you.

noobanidus avatar Apr 16 '24 02:04 noobanidus

Ok, thanks for helping

LThreeZeroT avatar Apr 17 '24 19:04 LThreeZeroT

I will try to see what the other mod that's affecting my game is.

LThreeZeroT avatar Apr 17 '24 19:04 LThreeZeroT