mojira.dev
MC-120709

Lava and water updates do not resolve completely when random ticking is disabled

The bug

When water or lava source is clearing, water or lava spread doesn't clear all the way unless they receive random ticks. It appears to be the level of snow layers.

A block can be placed to clear it. A torch can also be placed on it to remove it.

How to reproduce

  • Create a world with seed -6222383818302921049

  • Disable random ticks (/gamerule randomTickSpeed 0), to simulate a fix for MC-93468

  • Remove the lava source block at 247 17 -27

Linked issues

Attachments

Comments 19

ehm this is unrelated to random ticks. it's caused by faulty world generation and has been in the game for years. here's it happening in 1.12.2:

https://imgur.com/a/PNk9P

Are you sure? This report does not describe fluid bugs caused by world generation.

It's not caused by random ticks, but it used to be fixed by them. It has been in the game for a long time, that is true.

It's only linked as related so that developers looking at the bug can find the other one. The actual cause is almost definitely unrelated (unchecked, though - fluids are not fun) (and probably linking will be changed now that the other one has been reopened).

Ilmango is right. I was the one who posted this bug for the 1.12.2 issue.
These issues happened from water sources already set in the world.

9 more comments

I can confirm that moving the "return" statement one bracket up fixes the issue on a 1.12.2 server.

This is the diff for a CraftBukkit-Server:

--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -630,9 +630,10 @@ public class WorldServer extends World implements IAsyncTaskHandler {
                     if (iblockdata.getMaterial() != Material.AIR && iblockdata.getBlock() == block) {
                         iblockdata.getBlock().b((World) this, blockposition, iblockdata, this.random);
                     }
+
+                    return; // Fix MC-120709
                 }
 
-                return;
             }
 
             i = 1;
--

I can confirm that changing it so that a tick is queued when the area isn't loaded (i.e. moving the return statement up) fixes generation for the test case above.

It does not solve the actual problem that causes liquids to get stuck. Worlds that were generated before the fix (with random ticks disabled) will still have the issue afterwards. That probably would be fine for a minor update (and, the way it's currently generated is bad in other ways, so it's still a good fix).

If someone wants to look at what actually is causing the water/lava to get stuck, here's a tip: there's a debug renderer that displays the current state of liquids, including whether they are in the flowing variant or not. This renderer is designed for water, but it can be fairly trivially modified to support lava instead. The renderer itself is (mcp naming) net.minecraft.client.renderer.debug.DebugRendererWater (to use lava, case-sensitive replace the 5 occurrences of WATER with LAVA), and it can be enabled by setting waterEnabled to true in net.minecraft.client.renderer.debug.DebugRenderer (there is no hotkey to toggle this ingame in vanilla). Note that this is a debug renderer and there are some visual issues with it.

Here's some screenshots of the flows both before and after the source block is removed with that renderer enabled. These screenshots are without the fix given above.

[media][media][media][media]

The thing to look out for in testing seems to be blocks stuck in the flowing state - those are the ones that don't ever dissipate.

I'm currently not investigating this myself - this is just information that may be useful to others.

Seems like block updates should force liquids to go in stationary state. Random ticks shouldn't influence liquid flowing speed, so it won't affect cobblestone generators. In this example liquid will go back in flowing state, hopefully restarting the timer.

I guess you could technically fix it by scheduling a tile tick for every water and lava block in the world when converting a world to 1.13 and fix the return statement as described before.
If it is water or lava in an illegal state, I honestly see no other way besides refactoring liquid code entirely.

Can confirm for 17w47b

AlphaLibre

Erik Broes

Confirmed

lava, level, randomTickSpeed, water

Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47b, Minecraft 17w48a

Minecraft 1.12.2, Minecraft 17w50a

Retrieved