Lithium (Fabric)

Lithium (Fabric)

22M Downloads

Hatched Turtle Home Beach Coordinates Incorrect

mrgrim opened this issue · 8 comments

commented

We've been experiencing an issue where newly hatched turtles do not have their home beach coordinates set correctly. Sometimes they can be off by hundreds or even thousands of blocks and can be on any block type. We've narrowed down the issue to Lithium and have reproduced it on 0.4.4 and 0.4.5.

Additionally, we've observed hatched turtles home positions changing over time seemingly randomly.

Thanks!

commented

Here's some screencaps of the /data get entity, the one spawned by the game doesn't alter it's HomePos coords, but the Hatched "Test" one does repeatedly.
2020-03-15_16 15 08
2020-03-15_16 20 26
2020-03-15_16 18 24
2020-03-15_16 21 51

commented

We've only tested on Fabric. I'm unsure if it's also happening with the Forge release.

commented

Come to think of it, we tried vanilla but did not try a no mod fabric server. We can attempt that tomorrow most likely if you're having trouble reproducing.

commented

Is this occurring with the Forge or Fabric releases?

commented

Lithium 0.4.6 has been released on CurseForge with a fix for this issue.

commented

The cause of the issue here is that we're passing mutable block position references to the methods responsible for ticking blocks, which will cause a wide range of trouble for any code that doesn't try to convert it to an immutable reference.

In the case with turtle eggs, their random tick handler passes this mutable reference to the newly spawned turtle's home position. Since the reference is a scratch position for block ticking, the value it represents is essentially always changing and random. It can represent the position of any currently ticking block in the world!

I'm promoting this to critical status because this has the ability to cause many other problems in the game.

commented

Oh wow, thanks for the quick turn around! Is there anything we can do to work around the issue in the meantime? Perhaps one of the config options?

commented

I'm currently working on backporting and wrapping up a few other bug fixes for Lithium 0.4.6. It should be available very shortly. For the meantime, you can add the following to your lithium.toml configuration file.

[general]
reduce_object_allocations = false # https://github.com/jellysquid3/Lithium/issues/20