cc-restitched icon indicating copy to clipboard operation
cc-restitched copied to clipboard

[1.18.x] Chunks with computers in them fail to save on singleplayer.

Open Awsomekeldeo opened this issue 2 years ago • 6 comments
trafficstars

Minecraft Version

1.18.x

Version

1.100.8

Details

How to reproduce:

  1. Load up a singleplayer world.
  2. Place a computer down and turn it on.
  3. Save and quit
  4. Reload world, computer is gone.

The logs show that the chunk is failing to save. latest.log

Awsomekeldeo avatar Apr 24 '23 23:04 Awsomekeldeo

That is a pretty big issue... how the hell did it never come up before??

can you verify if the chunks actually do save? like place a computer, make an edit, exit the world and load back in?

Merith-TK avatar Apr 24 '23 23:04 Merith-TK

It seems like the chunks will actually save if you wait on the pause menu long enough, but if you quit out too quickly the chunks don't save.

Here's a video of that happening:

https://user-images.githubusercontent.com/25468235/234452314-02d27a96-2636-4607-acb3-66abfe218b71.mp4

And of course, the logs: latest.log

Awsomekeldeo avatar Apr 26 '23 02:04 Awsomekeldeo

hmm... I don't know what could be causing that, looks like the computer might cause an delay in saving properly as the lua code gets stopped??

Realistically on servers this won't be an issue when the server takes its time to save but yeah...

@SquidDev ideas?

Merith-TK avatar Apr 26 '23 05:04 Merith-TK

This is pretty similar to #146, and I guess https://github.com/cc-tweaked/CC-Tweaked/issues/956 too. Really the best thing to do here is what we've done on the CC:T side and remove as many usages of GameInstanceUtils.getServer as possible. So:

  • NetworkHandler.sendToAllPlayers should accept a MinecraftServer argument rather than magic-ing it up.
  • ServerComputer and any block entities should fetch the server from the their Level.

SquidDev avatar Apr 26 '23 08:04 SquidDev

@Merith-TK Hello, when a turtle moves outside of a chunk while I'm quitting the game in a singleplayer world or in a LAN world, the turtle literally disappears out of existence. I think this is a very serious problem with this mod. Also when a turtle is moving inside a chunk and I quit and enter the world, the turtle starts from it's past place, not the current place, making the mod unreliable. Please fix this issue.

Here is a video demonstrating the first issue: https://github.com/cc-tweaked/cc-restitched/assets/136577948/fe2f992a-3141-4493-b5db-cc5a8bdf7774

Here is the log file: latest.log

Thanks.

0xPascal avatar Sep 11 '23 23:09 0xPascal

As the earlier mentions in this issue say, the chunk itself doesn't save properly when computers are running in it, not just turtles,

So the issue is more serious than just turtles, someone made an potential fix that needs to be tested however

Merith-TK avatar Sep 13 '23 12:09 Merith-TK