Panda4994 / chunkdisplay

A Minecraft datapack to visualize chunk loading
9 stars 1 forks source link

No display appears in 1.14 #13

Open Scarabytes opened 5 years ago

Scarabytes commented 5 years ago

It might be just me, but when I installed the datapack in a new 1.14 world and clicked "create" in the book, no blocks were set. The variables in pcd_tmp are updated though, so it might be an issue with finding marker entities or something?

Panda4994 commented 5 years ago

Thank you for the report. I didn't update the display to 1.14 yet, but I spent some time today trying to understand what the issue is. Your guess is already spot on :-)

So before 1.14 it was possible to teleport entities into unloaded chunks and still find them again with selectors. This seems to have changed. There is a part of code that teleports the entity to the right dimension and also to some super far out coordinate (not sure why I did that). If I remove that part the display works but only in loaded chunks. As soon as it is larger than the render distance, the query-entity gets lost in the first unloaded chunk it discovers. The teleportation is in "zzz_chunkdisplay/functions/loop_detect_chunk/head.mcfunction". Though I think there are other things that also cause issues still (besides what I mentioned already).

Now, a chunkdisplay that only works in loaded chunks isn't very practical xD I need to figure out a new way to query the chunks without losing the entity in them. Also I'm worried that the entity might then stay in that chunk, so the display would eventually fill up unloaded chunks with entities, which could be a problem. A possible solution would be to fall back into using summon commands for querying. I did that at the very beginning, but it causes much more lag than teleporting only one entity around.

I will think about alternative solutions for the detection. E.g. it would be possible to hardcode the area the display can detect, but meh. It should stay fully configurable.

Scarabytes commented 5 years ago

I did some experiments myself and found out, that you can still access an entity in unloaded chunks if it is @s the whole time. So I guess, if you manage to do a while routine from within a single function that can be executed as the cursor entity, it should work again.

Panda4994 commented 5 years ago

That sounds like it is the way to go. The code needs some rework for that though, because it often follows two marker entities at a time (the one querying the chunk and the one at the position of the display to which this chunk belongs). I think it's fair to assume that the marker entity of the display itself is constantly loaded, or if it's not the display is not updated. So there should be a loop on top following the querying entity. All data about that chunk is then written to the tmp scoreboard (in a fake player) and then a second entity is placed relative to the display position marker. Then a subroutine is executed on that entity to write all the data out of the tmp-scoreboard into the display.

Sounds good to me, thanks a lot for the testing and the idea :-) I don't know when I will have time to implement it, but I will try to do so soon™.