Hatched Turtle Home Beach Coordinates Incorrect
mrgrim opened this issue · 8 comments
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!
We've only tested on Fabric. I'm unsure if it's also happening with the Forge release.
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.
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.
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?
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